From c857ecab468d50997e3b0280178f387480ecd5a3 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 30 Nov 2018 19:56:49 +0100 Subject: Create plink depending on message id format --- include/items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/items.php b/include/items.php index 2cee376d0..33ef6edad 100755 --- a/include/items.php +++ b/include/items.php @@ -420,7 +420,7 @@ function post_activity_item($arr, $allow_code = false, $deliver = true) { $arr['comment_policy'] = map_scope(PermissionLimits::Get($channel['channel_id'],'post_comments')); if ((! $arr['plink']) && (intval($arr['item_thread_top']))) { - $arr['plink'] = substr(z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . urlencode($arr['mid']),0,190); + $arr['plink'] = substr(z_root() . '/channel/' . $channel['channel_address'] . '/' . (filter_var($arr['mid'], FILTER_VALIDATE_URL) === false ? '?f=&mid=' : '') . urlencode($arr['mid']),0,190); } -- cgit v1.2.3