]> git.mxchange.org Git - friendica.git/blobdiff - include/oembed.php
Merge remote-tracking branch 'upstream/3.5.2rc' into 1705-dbclean-advanced
[friendica.git] / include / oembed.php
index d0a2bc8643ae42bedb8a91aa0e9d83cf96ef1e47..d28a97e322046690eee01300199ceca9891090c4 100755 (executable)
@@ -4,8 +4,9 @@
  * @file include/oembed.php
  */
 
-use \Friendica\ParseUrl;
-use \Friendica\Core\Config;
+use Friendica\App;
+use Friendica\ParseUrl;
+use Friendica\Core\Config;
 
 function oembed_replacecb($matches){
        $embedurl=$matches[1];
@@ -74,17 +75,6 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){
                        }
                }
 
-               if ($txt==false || $txt=="") {
-                       $embedly = Config::get("system", "embedly");
-                       if ($embedly != "") {
-                               // try embedly service
-                               $ourl = "https://api.embed.ly/1/oembed?key=".$embedly."&url=".urlencode($embedurl);
-                               $txt = fetch_url($ourl);
-
-                               logger("oembed_fetch_url: ".$txt, LOGGER_DEBUG);
-                       }
-               }
-
                $txt = trim($txt);
 
                if ($txt[0] != "{") {
@@ -314,9 +304,11 @@ function oembed_html2bbcode($text) {
                $entries = $xpath->query("//span[$xattr]");
 
                $xattr = "@rel='oembed'";//oe_build_xpath("rel","oembed");
-               foreach($entries as $e) {
+               foreach ($entries as $e) {
                        $href = $xpath->evaluate("a[$xattr]/@href", $e)->item(0)->nodeValue;
-                       if(!is_null($href)) $e->parentNode->replaceChild(new DOMText("[embed]".$href."[/embed]"), $e);
+                       if (!is_null($href)) {
+                               $e->parentNode->replaceChild(new DOMText("[embed]".$href."[/embed]"), $e);
+                       }
                }
                return oe_get_inner_html( $dom->getElementsByTagName("body")->item(0) );
        } else {