From 96f196febda488e1db2d9a677fd5eb736aa76ae6 Mon Sep 17 00:00:00 2001 From: Hubzilla Date: Thu, 19 Jan 2017 15:37:30 -0800 Subject: add gen_link_id() function to selectively encode/decode the message-id component of /display/ links for message-ids that contain troublesome characters --- Zotlabs/Module/Item.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Module/Item.php') diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index d5fac306b..48992a676 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -724,6 +724,8 @@ class Item extends \Zotlabs\Web\Controller { if(! $mid) { $mid = (($message_id) ? $message_id : item_message_id()); } + + if(! $parent_mid) { $parent_mid = $mid; } @@ -935,7 +937,7 @@ class Item extends \Zotlabs\Web\Controller { 'from_xchan' => $datarray['author_xchan'], 'to_xchan' => $datarray['owner_xchan'], 'item' => $datarray, - 'link' => z_root() . '/display/' . urlencode($datarray['mid']), + 'link' => z_root() . '/display/' . gen_link_id($datarray['mid']), 'verb' => ACTIVITY_POST, 'otype' => 'item', 'parent' => $parent, @@ -953,7 +955,7 @@ class Item extends \Zotlabs\Web\Controller { 'from_xchan' => $datarray['author_xchan'], 'to_xchan' => $datarray['owner_xchan'], 'item' => $datarray, - 'link' => z_root() . '/display/' . urlencode($datarray['mid']), + 'link' => z_root() . '/display/' . gen_link_id($datarray['mid']), 'verb' => ACTIVITY_POST, 'otype' => 'item' )); @@ -1005,7 +1007,7 @@ class Item extends \Zotlabs\Web\Controller { } $datarray['id'] = $post_id; - $datarray['llink'] = z_root() . '/display/' . urlencode($datarray['mid']); + $datarray['llink'] = z_root() . '/display/' . gen_link_id($datarray['mid']); call_hooks('post_local_end', $datarray); -- cgit v1.2.3