diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-05-04 09:46:27 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-05-04 09:46:27 +0200 |
commit | be4c9a9598350fb4333480f0c7b302acebcddfd4 (patch) | |
tree | fb0c2606ad4ca0bc1a710d6fdf82f55c326b3427 /include/zid.php | |
parent | f15c12376adad6534c8c0ea547a7548697eb8379 (diff) | |
parent | be852ba857f4cb8e75574a762945b50c8bddcff9 (diff) | |
download | volse-hubzilla-be4c9a9598350fb4333480f0c7b302acebcddfd4.tar.gz volse-hubzilla-be4c9a9598350fb4333480f0c7b302acebcddfd4.tar.bz2 volse-hubzilla-be4c9a9598350fb4333480f0c7b302acebcddfd4.zip |
Merge branch '3.4RC'3.4
Diffstat (limited to 'include/zid.php')
-rw-r--r-- | include/zid.php | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/include/zid.php b/include/zid.php index 67c1d9f6c..fe06948ba 100644 --- a/include/zid.php +++ b/include/zid.php @@ -53,14 +53,14 @@ 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_parsed['host'] === $s_parsed['host']) + $url_match = true; - if ($mine && $myaddr && (! link_compare($mine,$s))) - $zurl = $s . (($num_slashes >= 3) ? '' : '/') . $achar . 'zid=' . urlencode($myaddr); + if ($mine && $myaddr && (! $url_match)) + $zurl = $s . (($num_slashes >= 3) ? '' : '/') . (($achar === '?') ? '?f=&' : '&') . 'zid=' . urlencode($myaddr); else $zurl = $s; @@ -103,12 +103,17 @@ 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 = '') { $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'); } @@ -346,4 +351,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 +} |