Skip to content

Commit

Permalink
Bug fix : Changed the condition at which an empty array is returned.
Browse files Browse the repository at this point in the history
  • Loading branch information
anagh-p committed Sep 15, 2016
1 parent 89b76c6 commit d532d8b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Quintype/Seo/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,28 @@ private function getSeoMetadata() {

if(sizeof($this->config['seo-metadata'])>0){
$key = 'owner-type';
$found = 0;

if($this->pageType == 'section'){//If it is a section page.
foreach ($this->config['seo-metadata'] as $metadata) {
if (array_key_exists($key, $metadata) && $metadata[$key]==$this->pageType && $metadata['owner-id']==$this->section_id) {
$found = 1;
return $metadata['data'];
} else {
return array();
}
}
if(!$found){
return array();
}
} else {
foreach ($this->config['seo-metadata'] as $metadata) {
if (array_key_exists($key, $metadata) && $metadata[$key]==$this->pageType) {
$found = 1;
return $metadata['data'];
} else {
return array();
}
}
if(!$found){
return array();
}
}

} else {
Expand Down

0 comments on commit d532d8b

Please sign in to comment.