diff options
author | zotlabs <mike@macgirvin.com> | 2017-08-21 15:00:45 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-08-21 15:00:45 -0700 |
commit | 894f0156afdb605883af4c3419ead4aec09617da (patch) | |
tree | 08ef4576df5578cdc18bfa39c9f61aa3c8672173 /Zotlabs | |
parent | 9d5b6858ea627b5eb6115cacd870ef0277f87b2a (diff) | |
download | volse-hubzilla-894f0156afdb605883af4c3419ead4aec09617da.tar.gz volse-hubzilla-894f0156afdb605883af4c3419ead4aec09617da.tar.bz2 volse-hubzilla-894f0156afdb605883af4c3419ead4aec09617da.zip |
more work on oembed from /display
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Display.php | 8 | ||||
-rw-r--r-- | Zotlabs/Module/Linkinfo.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Oep.php | 8 |
3 files changed, 10 insertions, 8 deletions
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index d82ff2a55..5e03f91a9 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -174,6 +174,8 @@ class Display extends \Zotlabs\Web\Controller { '$verb' => '', '$mid' => $item_hash )); + + \App::$page['htmlhead'] .= "\r\n" . '<link rel="alternate" type="application/json+oembed" href="' . z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string) . '" title="oembed" />' . "\r\n"; } @@ -218,13 +220,13 @@ class Display extends \Zotlabs\Web\Controller { if(! perm_is_allowed($sysid,$observer_hash,'view_stream')) $sysid = 0; - +dbg(1); $r = q("SELECT item.id as item_id from item WHERE mid = '%s' AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = '' AND item.deny_gid = '' AND item_private = 0 ) - and owner_xchan in ( " . stream_perms_xchans(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " )) + and uid in ( " . stream_perms_api_uids(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " )) OR uid = %d ) $sql_extra ) $item_normal @@ -232,7 +234,7 @@ class Display extends \Zotlabs\Web\Controller { dbesc($target_item['parent_mid']), intval($sysid) ); - +dbg(0); } } } diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index 8f8231c49..78c34583e 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -95,7 +95,7 @@ class Linkinfo extends \Zotlabs\Web\Controller { echo $arr['text']; killme(); } - + if($process_oembed) { $x = oembed_process($url); if($x) { diff --git a/Zotlabs/Module/Oep.php b/Zotlabs/Module/Oep.php index a3453ff31..6469a7007 100644 --- a/Zotlabs/Module/Oep.php +++ b/Zotlabs/Module/Oep.php @@ -66,9 +66,9 @@ class Oep extends \Zotlabs\Web\Controller { $url = $args['url']; $maxwidth = intval($args['maxwidth']); $maxheight = intval($args['maxheight']); - - if(preg_match('#//display/(.*?)(&|\?|$)#',$url,$matches)) { - $res = $matches[1]; + logger('processing display'); + if(preg_match('#//(.*?)/display/(.*?)(&|\?|$)#',$url,$matches)) { + $res = $matches[2]; } if(strpos($res,'b64.') === 0) { @@ -78,7 +78,7 @@ class Oep extends \Zotlabs\Web\Controller { $item_normal = item_normal(); $p = q("select * from item where mid like '%s' limit 1", - dbesc($res . '%'), + dbesc($res . '%') ); if(! $p) |