From cd65d172baab020802421db8e5b5d54033dafaa8 Mon Sep 17 00:00:00 2001 From: zottel Date: Thu, 9 Jan 2014 15:59:42 +0100 Subject: urlencode query_string for magic auth to make sure GET params make it back to the originating server --- include/identity.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/identity.php b/include/identity.php index 5e25244e6..9fba55da5 100644 --- a/include/identity.php +++ b/include/identity.php @@ -1023,7 +1023,7 @@ function zid_init(&$a) { dbesc($tmp_str) ); // try to avoid recursion - but send them home to do a proper magic auth - $dest = '/' . $a->query_string; + $dest = '/' . urlencode($a->query_string); $dest = str_replace(array('?zid=','&zid='),array('?rzid=','&rzid='),$dest); if($r && ($r[0]['hubloc_url'] != z_root()) && (! strstr($dest,'/magic')) && (! strstr($dest,'/rmagic'))) { goaway($r[0]['hubloc_url'] . '/magic' . '?f=&rev=1&dest=' . z_root() . $dest); @@ -1140,4 +1140,4 @@ function is_foreigner($s) { function is_member($s) { return((is_foreigner($s)) ? false : true); -} \ No newline at end of file +} -- cgit v1.2.3 From c0f6d7319524f8fb8bac764d6e2f306335d2266b Mon Sep 17 00:00:00 2001 From: zottel Date: Thu, 9 Jan 2014 16:02:40 +0100 Subject: save channel//?mid=... plinks with the items --- include/items.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/items.php b/include/items.php index 781956882..883458b6e 100755 --- a/include/items.php +++ b/include/items.php @@ -1602,8 +1602,15 @@ function item_store($arr,$allow_exec = false) { $arr['llink'] = z_root() . '/display/' . $arr['mid']; - if(! $arr['plink']) - $arr['plink'] = $arr['llink']; + if(! $arr['plink']) { + if (local_user()){ + $channel = get_app()->get_channel(); + $arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?mid=' . $arr['mid']; + } else { + // can this ever happen? + $arr['plink'] = $arr['llink']; + } + } if($arr['parent_mid'] === $arr['mid']) { $parent_id = 0; -- cgit v1.2.3 From 5d83855afdd4ebf770462de7520e72ffb9c6c1c2 Mon Sep 17 00:00:00 2001 From: zottel Date: Thu, 9 Jan 2014 16:04:51 +0100 Subject: use plinks instead of llinks on network/ and channel/ pages, though not in mode network-new (network/new and network/search) --- include/text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index 8b71fbddf..b47f0518a 100755 --- a/include/text.php +++ b/include/text.php @@ -1391,7 +1391,7 @@ function feed_salmonlinks($nick) { function get_plink($item,$mode) { $a = get_app(); - if($mode == 'display') + if(($mode == 'display') || ($mode == 'channel') || ($mode == 'network')) $key = 'plink'; else $key = 'llink'; -- cgit v1.2.3 From acdf053a0bec73acaad3f6c0e0625aa860a4b9b3 Mon Sep 17 00:00:00 2001 From: zottel Date: Thu, 9 Jan 2014 17:29:04 +0100 Subject: use display/ plinks for comments --- include/items.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/items.php b/include/items.php index 883458b6e..d5eea1e6f 100755 --- a/include/items.php +++ b/include/items.php @@ -1602,12 +1602,11 @@ function item_store($arr,$allow_exec = false) { $arr['llink'] = z_root() . '/display/' . $arr['mid']; - if(! $arr['plink']) { - if (local_user()){ + if((! $arr['plink'])) { + if (local_user() && ($arr['item_flags'] & ITEM_THREAD_TOP)) { $channel = get_app()->get_channel(); $arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?mid=' . $arr['mid']; } else { - // can this ever happen? $arr['plink'] = $arr['llink']; } } -- cgit v1.2.3