diff options
author | Mario <mario@mariovavti.com> | 2019-08-09 20:26:54 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-08-09 20:26:54 +0200 |
commit | 940e4a6152bdbcc7540e6244630187e84f365f3f (patch) | |
tree | 8979c7d7382a8fca71bd5309f24dcda3cd4ba2c4 /Zotlabs/Module | |
parent | e896d316f263281c8ff1447c2eeff853f1741176 (diff) | |
parent | 38f7d9ad371380763c129b66b44a227cc7035e1e (diff) | |
download | volse-hubzilla-940e4a6152bdbcc7540e6244630187e84f365f3f.tar.gz volse-hubzilla-940e4a6152bdbcc7540e6244630187e84f365f3f.tar.bz2 volse-hubzilla-940e4a6152bdbcc7540e6244630187e84f365f3f.zip |
Merge branch 'dev' into 'dev'
Replace plink URL with 'share' tag if possible
See merge request hubzilla/core!1703
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Linkinfo.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index 1551d1f26..7d6ff4043 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -2,9 +2,6 @@ namespace Zotlabs\Module; - - - class Linkinfo extends \Zotlabs\Web\Controller { function get() { @@ -48,7 +45,20 @@ class Linkinfo extends \Zotlabs\Web\Controller { } logger('linkinfo: ' . $url); - + + // Replace plink URL with 'share' tag if possible + if (preg_match("/mid=b64\.(\w+)(&.+)?$/", $url, $mid)) { + + $r = q("SELECT id FROM item WHERE mid = '%s' AND uid = %d LIMIT 1", + dbesc(base64url_decode($mid[1])), + intval(local_channel()) + ); + if ($r) { + echo "[share=" . $r[0]['id'] . "][/share]"; + killme(); + } + } + $result = z_fetch_url($url,false,0,array('novalidate' => true, 'nobody' => true)); if($result['success']) { $hdrs=array(); |