From: Antonio Ospite Date: Fri, 9 Nov 2018 14:42:28 +0000 (+0100) Subject: src/Tweeper.php: silence error message when processing Instagram json X-Git-Tag: v1.4.0~11 X-Git-Url: https://git.ao2.it/tweeper.git/commitdiff_plain/55a2513471e979aa4ed9eb2374ca28bdd06897de?ds=inline src/Tweeper.php: silence error message when processing Instagram json 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. --- diff --git a/src/Tweeper.php b/src/Tweeper.php index 831f47d..f25ea25 100644 --- a/src/Tweeper.php +++ b/src/Tweeper.php @@ -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');