aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-20 01:29:41 -0800
committerfriendica <info@friendica.com>2014-01-20 01:29:41 -0800
commit1fa8546d467bcd541858967aaec33d8779e4df99 (patch)
tree1f402adaa49b4a080465463ade48c467ebb071b0 /include
parentfdfea0a8e932bdb8d243c7b81bcdb9acefb28d4d (diff)
downloadvolse-hubzilla-1fa8546d467bcd541858967aaec33d8779e4df99.tar.gz
volse-hubzilla-1fa8546d467bcd541858967aaec33d8779e4df99.tar.bz2
volse-hubzilla-1fa8546d467bcd541858967aaec33d8779e4df99.zip
zidify audio/video links
Diffstat (limited to 'include')
-rwxr-xr-xinclude/oembed.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/include/oembed.php b/include/oembed.php
index 520b69892..6946ba4b8 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -26,7 +26,20 @@ function oembed_fetch_url($embedurl){
if(is_null($txt)){
$txt = "";
- if (!in_array($ext, $noexts)){
+ if (in_array($ext, $noexts)) {
+ $m = @parse_url($embedurl);
+ $zrl = false;
+ if($m['host']) {
+ $r = q("select hubloc_url from hubloc where hubloc_host = '%s' limit 1",
+ dbesc($m['host'])
+ );
+ if($r)
+ $zrl = true;
+ }
+ if($zrl)
+ $embedurl = zid($embedurl);
+ }
+ else {
// try oembed autodiscovery
$redirects = 0;
@@ -57,12 +70,6 @@ function oembed_fetch_url($embedurl){
call_hooks('oembed_probe',$x);
if(array_key_exists('embed',$x))
$txt = $x['embed'];
-
- // try oohembed service
-// $ourl = "http://oohembed.com/oohembed/?url=".urlencode($embedurl).'&maxwidth=' . $a->videowidth;
-// $result = z_fetch_url($ourl);
-// if($result['success'])
-// $txt = $result['body'];
}
$txt=trim($txt);