PEEL Shopping
Open source ecommerce : PEEL Shopping
modifier.regex_replace.php
Go to the documentation of this file.
1 <?php
24 function smarty_modifier_regex_replace($string, $search, $replace)
25 {
26  if(is_array($search)) {
27  foreach($search as $idx => $s) {
29  }
30  } else {
32  }
33  return preg_replace($search, $replace, $string);
34 }
35 
42 {
43  // null-byte injection detection
44  // anything behind the first null-byte is ignored
45  if (($pos = strpos($search,"\0")) !== false) {
46  $search = substr($search,0,$pos);
47  }
48  // remove eval-modifier from $search
49  if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) {
50  $search = substr($search, 0, -strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]);
51  }
52  return $search;
53 }
54 
55 ?>
_smarty_regex_replace_check($search)
smarty_modifier_regex_replace($string, $search, $replace)
Smarty regex_replace modifier plugin.
$search
Definition: rpc.php:29
$match
Definition: search.php:86

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:16 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.