Game/Text

* try to catch more html-like constructs in text blobs and escape them
 * ...<hic>!
This commit is contained in:
Sarjuuk
2023-03-20 21:01:30 +01:00
parent 6f87870e09
commit 138dbbc8a5

View File

@@ -707,6 +707,9 @@ abstract class Util
else
$text = strtr($text, ["\n" => $markdown ? '[br]' : '<br />', "\r" => '']);
// escape fake html-ish tags the browser skipsh dishplaying ...<hic>!
$text = preg_replace('/<([^\s\/]+)>/iu', '&lt;\1&gt;', $text);
$from = array(
'/\|T([\w]+\\\)*([^\.]+)\.blp:\d+\|t/ui', // images (force size to tiny) |T<fullPath>:<size>|t
'/\|c(\w{6})\w{2}([^\|]+)\|r/ui', // color |c<RRGGBBAA><text>|r