first commit
This commit is contained in:
12
class/smarty_plugins/modifier.xml_string.php
Normal file
12
class/smarty_plugins/modifier.xml_string.php
Normal 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(['&', '<', '>'], ['&', '<', '>'], $string);
|
||||
$string = preg_replace('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $string);
|
||||
|
||||
return $string;
|
||||
}
|
||||
Reference in New Issue
Block a user