[NineGagBridge] Fix missing sections breaking feeds
Posts may supply a list of 'sections' or a single 'postSection' References #844
This commit is contained in:
parent
ae58b1566e
commit
243e324efc
1 changed files with 9 additions and 1 deletions
|
@ -304,7 +304,15 @@ class NineGagBridge extends BridgeAbstract {
|
||||||
protected static function getCategories($post) {
|
protected static function getCategories($post) {
|
||||||
$params = self::PARAMETERS;
|
$params = self::PARAMETERS;
|
||||||
$sections = $params['Sections']['g']['values'];
|
$sections = $params['Sections']['g']['values'];
|
||||||
$postSections = $post['sections'];
|
|
||||||
|
if(isset($post['sections'])) {
|
||||||
|
$postSections = $post['sections'];
|
||||||
|
} elseif (isset($post['postSection'])) {
|
||||||
|
$postSections = array($post['postSection']);
|
||||||
|
} else {
|
||||||
|
$postSections = array();
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($postSections as $key => $section) {
|
foreach ($postSections as $key => $section) {
|
||||||
$postSections[$key] = array_search($section, $sections);
|
$postSections[$key] = array_search($section, $sections);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue