]> git.mxchange.org Git - friendica.git/commitdiff
Escape dollar sign in replace string to prevent placeholder replacement in Model...
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 26 Nov 2021 17:38:34 +0000 (12:38 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Fri, 26 Nov 2021 17:38:34 +0000 (12:38 -0500)
src/Model/Item.php

index 923d72c11bcd37cf7955897553759bc9c93d2d45..0a3ed1ddc52abd9c667ccdaed2a00e2ac6c594a2 100644 (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);