diff options
author | zotlabs <mike@macgirvin.com> | 2019-05-13 05:14:43 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2019-05-13 05:14:43 -0700 |
commit | 436293713bab05f11981c963139e51cba25967f1 (patch) | |
tree | ce8a6dc8b7267ccb1f140e0df96273acc092ab41 /include/bbcode.php | |
parent | 960f4ed649cfaca14628a65d136b4f40d4cee0d1 (diff) | |
download | volse-hubzilla-436293713bab05f11981c963139e51cba25967f1.tar.gz volse-hubzilla-436293713bab05f11981c963139e51cba25967f1.tar.bz2 volse-hubzilla-436293713bab05f11981c963139e51cba25967f1.zip |
bbcode map bypass wasn't catching all map forms.
Diffstat (limited to 'include/bbcode.php')
-rw-r--r-- | include/bbcode.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index 1c153677d..33219c67d 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -986,19 +986,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\]/", '<div class="map"></div>', $Text); + } } - if (strpos($Text,'[map]') !== false) { - $Text = preg_replace("/\[map\]/", '<div class="map"></div>', $Text); - } - + // Check for bold text if (strpos($Text,'[b]') !== false) { $Text = preg_replace("(\[b\](.*?)\[\/b\])ism", '<strong>$1</strong>', $Text); |