aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2019-08-11 10:23:14 +0200
committerMario Vavti <mario@mariovavti.com>2019-08-11 10:23:14 +0200
commit7a7f57fa451dd5bba07fcc7155a21f233051877e (patch)
tree913ae963a4def8afb40c2f683eb27b04c5bc2d08
parent0e0024218fdf8745137e87bb965fbbfa17c877b8 (diff)
parent047dd31724f8da12c153b4a6f27dc5462f7b97e5 (diff)
downloadvolse-hubzilla-7a7f57fa451dd5bba07fcc7155a21f233051877e.tar.gz
volse-hubzilla-7a7f57fa451dd5bba07fcc7155a21f233051877e.tar.bz2
volse-hubzilla-7a7f57fa451dd5bba07fcc7155a21f233051877e.zip
Merge branch 'dev' into 4.4RC
-rw-r--r--Zotlabs/Module/Linkinfo.php26
1 files changed, 14 insertions, 12 deletions
diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php
index 7d6ff4043..fcf8a6aa1 100644
--- a/Zotlabs/Module/Linkinfo.php
+++ b/Zotlabs/Module/Linkinfo.php
@@ -46,18 +46,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();
- }
- }
+ // Replace plink URL with 'share' tag if possible
+ preg_match("/(mid=b64\.|display\/|posts\/)([\w\-]+)(&.+)?$/", $url, $mid);
+
+ if (!empty($mid) && $mid[1] == 'mid=b64.')
+ $mid[2] = base64_decode($mid[2]);
+
+ $r = q("SELECT id FROM item WHERE mid = '%s' AND uid = %d LIMIT 1",
+ dbesc((empty($mid) ? $url : $mid[2])),
+ 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']) {