]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
purify oembed html
authorhannes <h@nnesmannerhe.im>
Wed, 13 Jan 2016 16:03:38 +0000 (16:03 +0000)
committerhannes <h@nnesmannerhe.im>
Wed, 13 Jan 2016 16:03:38 +0000 (16:03 +0000)
plugins/Oembed/lib/oembedhelper.php

index 7abd76109a0e488f4cd8cb31fc6f5b063fcb8a01..b0527b75299e5ad48b85b9cb3c03ce356d9f0795 100644 (file)
@@ -158,7 +158,15 @@ class oEmbedHelper
         if(isset($key)) {
             $params['key'] = common_config('oembed','apikey');
         }
-        return HTTPClient::quickGetJson($api, $params);
+        
+        $oembed_data = HTTPClient::quickGetJson($api, $params);
+        
+        // purify html
+        if(isset($oembed_data->html)) {
+               $oembed_data->html = common_purify($oembed_data->html);
+               }
+        
+        return $oembed_data;
     }
 
     /**
@@ -211,4 +219,4 @@ class oEmbedHelper_DiscoveryException extends oEmbedHelper_Exception
     {
         return parent::__construct('No oEmbed discovery data.', 0, $previous);
     }
-}
+}
\ No newline at end of file