aboutsummaryrefslogtreecommitdiffstats
path: root/include/oembed.php
diff options
context:
space:
mode:
authormrjive <mrjive@mrjive.it>2016-02-01 11:25:07 +0100
committermrjive <mrjive@mrjive.it>2016-02-01 11:25:07 +0100
commit337735094b944fd31ed96e36c869227a0d63e5d1 (patch)
tree763577a8373b26426dc131c58f6a7f8c9c9213bf /include/oembed.php
parent28943af494eae225b256b9771a5699a1b05d7a2f (diff)
parent01b5b1347521951ca78b1718b03c45897800bf5e (diff)
downloadvolse-hubzilla-337735094b944fd31ed96e36c869227a0d63e5d1.tar.gz
volse-hubzilla-337735094b944fd31ed96e36c869227a0d63e5d1.tar.bz2
volse-hubzilla-337735094b944fd31ed96e36c869227a0d63e5d1.zip
Merge pull request #20 from redmatrix/master
updating from original codebase
Diffstat (limited to 'include/oembed.php')
-rwxr-xr-xinclude/oembed.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/oembed.php b/include/oembed.php
index e50d34c7d..2d3e0d3f9 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -78,7 +78,6 @@ function oembed_fetch_url($embedurl){
else {
// try oembed autodiscovery
$redirects = 0;
-
$result = z_fetch_url($embedurl, false, $redirects, array('timeout' => 15, 'accept_content' => "text/*", 'novalidate' => true ));
if($result['success'])
$html_text = $result['body'];
@@ -88,8 +87,8 @@ function oembed_fetch_url($embedurl){
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){
$href = $e->getAttributeNode("href")->nodeValue;
@@ -173,6 +172,14 @@ function oembed_format_object($j){
$ret.="<br>";
}; break;
case "link": {
+ if($j->thumbnail_url) {
+ if(is_matrix_url($embedurl)) {
+ $embedurl = zid($embedurl);
+ $j->thumbnail_url = zid($j->thumbnail_url);
+ }
+ $ret = '<a href="' . $embedurl . '" ><img src="' . $j->thumbnail_url . '" alt="thumbnail" /></a><br /><br />';
+ }
+
//$ret = "<a href='".$embedurl."'>".$j->title."</a>";
}; break;
case "rich": {