Skip to content

Commit

Permalink
Merge pull request #158 from pablor44/fix69-clean
Browse files Browse the repository at this point in the history
Fix issue 69 : OPML with folders
  • Loading branch information
SSilence committed Mar 26, 2013
2 parents 0ed907b + 8e9eb34 commit b75fe6e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions controllers/Opml.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,22 @@ function processGroup($xml,$tags = Array()){
$errors = Array();

// tags are the words of the outline parent
if((string)$xml['title']){
if((string)$xml['title'] && $xml['title']!='/'){
$tags[] = (string)$xml['title'];
}

// parse every outline item
foreach($xml->outline as $outline){
if((string)$outline['type']) {
$ret = $this->addSubscription($outline,$tags);
if($ret!==true) {
$errors[] = $ret;
//support folders in opml
if($outline['type']=='folder') {
$ret = $this->processGroup($outline,$tags);
$errors = array_merge($errors,$ret);
} else {
$ret = $this->addSubscription($outline,$tags);
if($ret!==true) {
$errors[] = $ret;
}
}
} else {
$ret = $this->processGroup($outline,$tags);
Expand Down

0 comments on commit b75fe6e

Please # to comment.