aboutsummaryrefslogtreecommitdiffstats
path: root/include/zid.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-03-15 14:53:18 +0100
committerMario Vavti <mario@mariovavti.com>2018-03-15 14:53:18 +0100
commit34fee2a7909674ced6aea91e60f8ff77e8345e8b (patch)
treecd52c1606a84f22a8ac67c522aa1cedfe30404db /include/zid.php
parent6c709551ce49feaa93b68253cb5767ad4cab66c1 (diff)
downloadvolse-hubzilla-34fee2a7909674ced6aea91e60f8ff77e8345e8b.tar.gz
volse-hubzilla-34fee2a7909674ced6aea91e60f8ff77e8345e8b.tar.bz2
volse-hubzilla-34fee2a7909674ced6aea91e60f8ff77e8345e8b.zip
match hosts instead of urls to decide if to zid or not to zid
Diffstat (limited to 'include/zid.php')
-rw-r--r--include/zid.php14
1 files changed, 7 insertions, 7 deletions
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
+}