diff options
author | Mario <mario@mariovavti.com> | 2019-05-14 09:10:48 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-05-14 09:10:48 +0200 |
commit | 71ecb470b637494337a06a961d921d5c5371c322 (patch) | |
tree | e2992d7140670336c3e5fff38add09cbba6073c9 /include | |
parent | 15a000bb4554b0dee168eb595c9390a555c59f74 (diff) | |
parent | 436293713bab05f11981c963139e51cba25967f1 (diff) | |
download | volse-hubzilla-71ecb470b637494337a06a961d921d5c5371c322.tar.gz volse-hubzilla-71ecb470b637494337a06a961d921d5c5371c322.tar.bz2 volse-hubzilla-71ecb470b637494337a06a961d921d5c5371c322.zip |
Merge branch 'dev' into 'dev'
bbcode map bypass wasn't catching all map forms.
See merge request hubzilla/core!1647
Diffstat (limited to 'include')
-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 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\]/", '<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); |