phpDocumentor Smarty
plugins
[ class tree: Smarty ] [ index: Smarty ] [ all elements ]

Source for file shared.escape_special_chars.php

Documentation is available at shared.escape_special_chars.php

  1. <?php
  2. /**
  3.  * Smarty shared plugin
  4.  * @package Smarty
  5.  * @subpackage plugins
  6.  */
  7.  
  8.  
  9. /**
  10.  * escape_special_chars common function
  11.  *
  12.  * Function: smarty_function_escape_special_chars<br>
  13.  * Purpose:  used by other smarty functions to escape
  14.  *           special chars except for already escaped ones
  15.  * @param string 
  16.  * @return string 
  17.  */
  18. {
  19.     if(!is_array($string))    {
  20.         $string preg_replace('!&(#?\w+);!''%%%SMARTY_START%%%\\1%%%SMARTY_END%%%'$string);
  21.         $string htmlspecialchars($string);
  22.         $string str_replace(array('%%%SMARTY_START%%%','%%%SMARTY_END%%%')array('&',';')$string);
  23.     }
  24.     return $string;    
  25. }
  26.  
  27. /* vim: set expandtab: */
  28.  
  29. ?>

Documentation generated on Tue, 24 Oct 2006 09:26:05 -0500 by phpDocumentor 1.3.1