Merge pull request #1661 from annando/issue-1640
Improved OEmbed detection
This commit is contained in:
commit
738fd3d309
|
@ -37,7 +37,6 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){
|
||||||
if ($dom){
|
if ($dom){
|
||||||
$xpath = new DOMXPath($dom);
|
$xpath = new DOMXPath($dom);
|
||||||
$attr = "oembed";
|
$attr = "oembed";
|
||||||
|
|
||||||
$xattr = oe_build_xpath("class","oembed");
|
$xattr = oe_build_xpath("class","oembed");
|
||||||
$entries = $xpath->query("//link[@type='application/json+oembed']");
|
$entries = $xpath->query("//link[@type='application/json+oembed']");
|
||||||
foreach($entries as $e){
|
foreach($entries as $e){
|
||||||
|
@ -45,6 +44,12 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){
|
||||||
$txt = fetch_url($href . '&maxwidth=' . $a->videowidth);
|
$txt = fetch_url($href . '&maxwidth=' . $a->videowidth);
|
||||||
break;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue