aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/identity.php4
-rwxr-xr-xinclude/items.php10
-rwxr-xr-xinclude/text.php2
3 files changed, 11 insertions, 5 deletions
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
+}
diff --git a/include/items.php b/include/items.php
index 781956882..d5eea1e6f 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1602,8 +1602,14 @@ 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() && ($arr['item_flags'] & ITEM_THREAD_TOP)) {
+ $channel = get_app()->get_channel();
+ $arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?mid=' . $arr['mid'];
+ } else {
+ $arr['plink'] = $arr['llink'];
+ }
+ }
if($arr['parent_mid'] === $arr['mid']) {
$parent_id = 0;
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';