first commit

This commit is contained in:
2025-08-02 16:30:27 +02:00
commit 23646bfcee
14851 changed files with 1750626 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
<?php
function smarty_modifier_xml_string($string)
{
$string = html_entity_decode($string, ENT_QUOTES, 'UTF-8');
// beware of the order of search@replace values
// str_replace() replaces left to right, it might replace a previously inserted value when doing multiple replacements
$string = str_replace(['&', '<', '>'], ['&amp;', '&lt;', '&gt;'], $string);
$string = preg_replace('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $string);
return $string;
}