From d7026fe36b2febd71329e8d9512a4305ae8c05c6 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 9 May 2019 22:06:32 -0700 Subject: use 'cache' flag to bbcode() on content destined for Zot6. We've seen rendered map HTML in a couple of places and these should never be rendered for outgoing content as they will only be purified on the other end. --- include/bbcode.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/bbcode.php b/include/bbcode.php index 36f943e46..1c153677d 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -987,11 +987,13 @@ 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 (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 (! $cache) { + 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); -- cgit v1.2.3