src/Tweeper.php: silence error message when processing Instagram json
authorAntonio Ospite <ao2@ao2.it>
Fri, 9 Nov 2018 14:42:28 +0000 (15:42 +0100)
committerAntonio Ospite <ao2@ao2.it>
Fri, 9 Nov 2018 14:42:28 +0000 (15:42 +0100)
Remove the "knobs" element from the Instagram json data because it
contains elements with an undefined namespace which results in an error
message when json is converted to XML.

src/Tweeper.php

index 831f47d..f25ea25 100644 (file)
@@ -255,6 +255,10 @@ class Tweeper {
     // element names, so remove it.
     unset($data["qe"]);
 
+    // The "knobs" object contains elements with undefined namespaces, so
+    // remove it to silence an error message.
+    unset($data["knobs"]);
+
     $json = json_encode($data);
 
     return Tweeper::jsonToXml($json, 'instagram');