00001 <?php 00023 function smarty_modifier_regex_replace($string, $search, $replace) 00024 { 00025 if(is_array($search)) { 00026 foreach($search as $idx => $s) 00027 $search[$idx] = _smarty_regex_replace_check($s); 00028 } else { 00029 $search = _smarty_regex_replace_check($search); 00030 } 00031 00032 return preg_replace($search, $replace, $string); 00033 } 00034 00035 function _smarty_regex_replace_check($search) 00036 { 00037 if (($pos = strpos($search,"\0")) !== false) 00038 $search = substr($search,0,$pos); 00039 if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) { 00040 /* remove eval-modifier from $search */ 00041 $search = substr($search, 0, -strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]); 00042 } 00043 return $search; 00044 } 00045 00046 /* vim: set expandtab: */ 00047 00048 ?>
| Copyright © 2003 - 2009 MyOOS [Shopsystem]. All rights reserved. MyOOS [Shopsystem] is Free Software released under the GNU/GPL License. Webmaster: info@r23.de (Impressum) |
|
