init
[garradin.git] / include / libs / template_lite / plugins / shared.escape_chars.php
1 <?php
2 /**
3 * template_lite tpl_escape_chars function
4 *
5 */
6
7 function tpl_escape_chars($string)
8 {
9 if(!is_array($string))
10 {
11 $string = preg_replace('!&(#?\w+);!', '%%%TEMPLATE_START%%%\\1%%%TEMPLATE_END%%%', $string);
12 $string = htmlspecialchars($string);
13 $string = str_replace(array('%%%TEMPLATE_START%%%','%%%TEMPLATE_END%%%'), array('&',';'), $string);
14 }
15 return $string;
16 }
17
18 ?>