where possible strip zid parameter from links that get pasted into posts so that they will get a correct zid when rendered

This commit is contained in:
zotlabs
2018-04-26 20:27:14 -07:00
committed by Mario Vavti
parent e33d8c288b
commit d0ba2cf6d4
3 changed files with 11 additions and 5 deletions

View File

@@ -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 = '') {