From 34fee2a7909674ced6aea91e60f8ff77e8345e8b Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 15 Mar 2018 14:53:18 +0100 Subject: match hosts instead of urls to decide if to zid or not to zid --- include/zid.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/zid.php') diff --git a/include/zid.php b/include/zid.php index 67c1d9f6c..5b5601191 100644 --- a/include/zid.php +++ b/include/zid.php @@ -53,13 +53,13 @@ function zid($s, $address = '') { $mine = get_my_url(); $myaddr = (($address) ? $address : get_my_address()); - /** - * @FIXME checking against our own channel url is no longer reliable. We may have a lot - * of urls attached to our channel. Should probably match against our site, since we - * will not need to remote authenticate on our own site anyway. - */ + $mine_parsed = parse_url($mine); + $s_parsed = parse_url($s); - if ($mine && $myaddr && (! link_compare($mine,$s))) + if($mine_parsed['host'] === $s_parsed['host']) + $url_match = true; + + if ($mine && $myaddr && (! $url_match)) $zurl = $s . (($num_slashes >= 3) ? '' : '/') . $achar . 'zid=' . urlencode($myaddr); else $zurl = $s; @@ -346,4 +346,4 @@ function owt_init($token) { info(sprintf( t('OpenWebAuth: %1$s welcomes %2$s'),\App::get_hostname(), $hubloc['xchan_name'])); logger('OpenWebAuth: auth success from ' . $hubloc['xchan_addr']); -} \ No newline at end of file +} -- cgit v1.2.3 From 1514b0f4e5c053df60b8873b5411c70be727d227 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 21 Mar 2018 21:19:18 -0700 Subject: initial support for alternative sort orders on the cloud pages. Can be triggered manually but further development is required. --- include/zid.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include/zid.php') diff --git a/include/zid.php b/include/zid.php index 5b5601191..5275c6d5a 100644 --- a/include/zid.php +++ b/include/zid.php @@ -109,6 +109,7 @@ function clean_query_string($s = '') { $x = strip_zids(($s) ? $s : \App::$query_string); $x = strip_owt($x); $x = strip_zats($x); + $x = strip_query_param($x,'sort'); return strip_query_param($x,'f'); } -- cgit v1.2.3 From d0ba2cf6d469f2cbaef3749525eb19fcf36ed26d Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 26 Apr 2018 20:27:14 -0700 Subject: where possible strip zid parameter from links that get pasted into posts so that they will get a correct zid when rendered --- include/zid.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/zid.php') 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('/&\;zid=(.*?)(&|$)/ism','$2',$s); + return strip_query_param($x,'f'); +} function clean_query_string($s = '') { -- cgit v1.2.3