Escape dollar sign in replace string to prevent placeholder replacement in Model\Item::addShareDataFromOriginal

This commit is contained in:
Hypolite Petovan 2021-11-26 12:38:34 -05:00
parent 3d77fd5e29
commit 1c5aef0685
1 changed files with 1 additions and 1 deletions

View File

@ -3354,7 +3354,7 @@ class Item
$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']);
return array_merge($item, $shared_item);