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.

This commit is contained in:
zotlabs
2019-05-09 22:06:32 -07:00
parent b9b65d7dfb
commit d7026fe36b
2 changed files with 17 additions and 15 deletions

View File

@@ -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\]/", '<div class="map"></div>', $Text);