Source for file modifier.escape.php
Documentation is available at modifier.escape.php
* Smarty escape modifier plugin
* Purpose: Escape the string according to escapement type
* @link http://smarty.php.net/manual/en/language.modifier.escape.php
* escape (Smarty online manual)
* @param html|htmlall|url|quotes|hex|hexentity|javascript
// escape unescaped single quotes
// escape every character into hex
for ($x= 0; $x < strlen($string); $x++ ) {
$return .= '%' . bin2hex($string[$x]);
for ($x= 0; $x < strlen($string); $x++ ) {
$return .= '&#x' . bin2hex($string[$x]) . ';';
// escape quotes and backslashes and newlines
return strtr($string, array('\\'=> '\\\\',"'"=> "\\'",'"'=> '\\"',"\r"=> '\\r',"\n"=> '\\n'));
/* vim: set expandtab: */
|