]> git.mxchange.org Git - friendica.git/commitdiff
Escape all the HTML pre-formatted blocks in Smilies::replaceFromArray
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 21 Jun 2019 00:22:26 +0000 (20:22 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 22 Jun 2019 08:16:02 +0000 (04:16 -0400)
src/Content/Smilies.php

index 9fbfd2d629c7109a4c4ca0777d393a363055c1a2..041662e1eb7f648e44120dd55992f1fb62bdfb62 100644 (file)
@@ -213,6 +213,7 @@ class Smilies
                        return $text;
                }
 
+               $text = preg_replace_callback('/<pre>(.*?)<\/pre>/ism', 'self::encode', $text);
                $text = preg_replace_callback('/<code>(.*?)<\/code>/ism', 'self::encode', $text);
 
                if ($no_images) {
@@ -231,6 +232,7 @@ class Smilies
                $text = self::strOrigReplace($smilies['texts'], $smilies['icons'], $text);
 
                $text = preg_replace_callback('/<code>(.*?)<\/code>/ism', 'self::decode', $text);
+               $text = preg_replace_callback('/<pre>(.*?)<\/pre>/ism', 'self::decode', $text);
 
                return $text;
        }