From 85a29fce942d645e653fb6766b61a3f00f376137 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 13 May 2019 12:14:43 +0000 Subject: bbcode map bypass wasn't catching all map forms. (cherry picked from commit 436293713bab05f11981c963139e51cba25967f1) --- include/bbcode.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index a675451f1..70183fda3 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -985,19 +985,22 @@ function bbcode($Text, $options = []) { // leave open the posibility of [map=something] // this is replaced in prepare_body() which has knowledge of the item location - - if (! $cache) { + if ($cache) { + $Text = str_replace([ '[map]','[/map]' ], [ '','' ], $Text); + $Text = preg_replace('/[map=(.*?)\]/ism','$1',$Text); + } + else { if (strpos($Text,'[/map]') !== false) { $Text = preg_replace_callback("/\[map\](.*?)\[\/map\]/ism", 'bb_map_location', $Text); } if (strpos($Text,'[map=') !== false) { $Text = preg_replace_callback("/\[map=(.*?)\]/ism", 'bb_map_coords', $Text); } + if (strpos($Text,'[map]') !== false) { + $Text = preg_replace("/\[map\]/", '
', $Text); + } } - if (strpos($Text,'[map]') !== false) { - $Text = preg_replace("/\[map\]/", '
', $Text); - } - + // Check for bold text if (strpos($Text,'[b]') !== false) { $Text = preg_replace("(\[b\](.*?)\[\/b\])ism", '$1', $Text); -- cgit v1.2.3