Improved OEmbed detection

2022.09-rc
Michael Vogel 2015-06-10 23:45:56 +02:00
rodzic 8e800af306
commit cad591b1ec
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -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;
}
}
}
}