Merge pull request #11031 from MrPetovan/bug/9720-share-preg_replace

Escape dollar sign in replace string to prevent placeholder replacement in Model\Item::addShareDataFromOriginal
This commit is contained in:
Michael Vogel
2021-11-26 20:42:50 +01:00
committed by GitHub

View File

@@ -3354,7 +3354,7 @@ class Item
$body = $shared_item['body']; $body = $shared_item['body'];
} }
$item['body'] = preg_replace("/\[share ([^\[\]]*)\].*\[\/share\]/ism", '[share $1]' . $body . '[/share]', $item['body']); $item['body'] = preg_replace("/\[share ([^\[\]]*)\].*\[\/share\]/ism", '[share $1]' . str_replace('$', '\$', $body) . '[/share]', $item['body']);
unset($shared_item['body']); unset($shared_item['body']);
return array_merge($item, $shared_item); return array_merge($item, $shared_item);