From 243e324efc14a849b63d1f1565e0d19cc6fcacf7 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sat, 22 Sep 2018 15:18:43 +0200 Subject: [PATCH] [NineGagBridge] Fix missing sections breaking feeds Posts may supply a list of 'sections' or a single 'postSection' References #844 --- bridges/NineGagBridge.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bridges/NineGagBridge.php b/bridges/NineGagBridge.php index b5cab485..362bc9ed 100644 --- a/bridges/NineGagBridge.php +++ b/bridges/NineGagBridge.php @@ -304,7 +304,15 @@ class NineGagBridge extends BridgeAbstract { protected static function getCategories($post) { $params = self::PARAMETERS; $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) { $postSections[$key] = array_search($section, $sections); }