]> git.mxchange.org Git - friendica.git/commitdiff
Improved OEmbed detection
authorMichael Vogel <icarus@dabo.de>
Wed, 10 Jun 2015 21:45:56 +0000 (23:45 +0200)
committerMichael Vogel <icarus@dabo.de>
Wed, 10 Jun 2015 21:45:56 +0000 (23:45 +0200)
include/oembed.php

index 26746af51c17e13d637c4c177940abec99dc5489..b32cb512be54a90d242f6cf9d15cbeebd8934df0 100755 (executable)
@@ -37,7 +37,6 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){
                                if ($dom){
                                        $xpath = new DOMXPath($dom);
                                        $attr = "oembed";
-
                                        $xattr = oe_build_xpath("class","oembed");
                                        $entries = $xpath->query("//link[@type='application/json+oembed']");
                                        foreach($entries as $e){
@@ -45,6 +44,12 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){
                                                $txt = fetch_url($href . '&maxwidth=' . $a->videowidth);
                                                break;
                                        }
+                                       $entries = $xpath->query("//link[@type='text/json+oembed']");
+                                       foreach($entries as $e){
+                                               $href = $e->getAttributeNode("href")->nodeValue;
+                                               $txt = fetch_url($href . '&maxwidth=' . $a->videowidth);
+                                               break;
+                                       }
                                }
                        }
                }