aboutsummaryrefslogtreecommitdiffstats
path: root/include/zid.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-04-26 20:27:14 -0700
committerzotlabs <mike@macgirvin.com>2018-04-26 20:27:14 -0700
commit7b445a5b39b887135854ba1b9aa6d9867d584ae5 (patch)
tree69b14c3ca2d9e23552873e2495e6f8d50392ec06 /include/zid.php
parentce13fef6aaf4a99fdecd9ff5374028e5ff117651 (diff)
downloadvolse-hubzilla-7b445a5b39b887135854ba1b9aa6d9867d584ae5.tar.gz
volse-hubzilla-7b445a5b39b887135854ba1b9aa6d9867d584ae5.tar.bz2
volse-hubzilla-7b445a5b39b887135854ba1b9aa6d9867d584ae5.zip
where possible strip zid parameter from links that get pasted into posts so that they will get a correct zid when rendered
Diffstat (limited to 'include/zid.php')
-rw-r--r--include/zid.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/zid.php b/include/zid.php
index 5275c6d5a..fe06948ba 100644
--- a/include/zid.php
+++ b/include/zid.php
@@ -60,7 +60,7 @@ function zid($s, $address = '') {
$url_match = true;
if ($mine && $myaddr && (! $url_match))
- $zurl = $s . (($num_slashes >= 3) ? '' : '/') . $achar . 'zid=' . urlencode($myaddr);
+ $zurl = $s . (($num_slashes >= 3) ? '' : '/') . (($achar === '?') ? '?f=&' : '&') . 'zid=' . urlencode($myaddr);
else
$zurl = $s;
@@ -103,6 +103,10 @@ function strip_zats($s) {
return preg_replace('/[\?&]zat=(.*?)(&|$)/ism','$2',$s);
}
+function strip_escaped_zids($s) {
+ $x = preg_replace('/&amp\;zid=(.*?)(&|$)/ism','$2',$s);
+ return strip_query_param($x,'f');
+}
function clean_query_string($s = '') {