Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 0.49 KB  |  hits: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Problem about a function of remove XSS
  2. for ($i = 0; $i < strlen($search); $i++) {
  3.       // ;? matches the ;, which is optional
  4.       // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars
  5.  
  6.       // @ @    
  7.       $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;
  8.       // @ @ 0{0,7} matches '0' zero to seven times  
  9.       $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;
  10.    }