Hi,
Here is a bug I discovered for PHP 5.2.
In this new version, the preg_replace does not seems to work properly.
Depending on the pattern and on the subject, it may return null rather than the unmodified string in case of no match.
It at least impact the Input.php file.
The result of this bug is that function xss_clean returns an empty string in some cases rather than the correct value.
I just created a function _safe_preg_replace, that takes the same parameters as the original functionand which simply check for the result.
/**
* This function is called in order to produce a safe preg_replace managing the PHP 5.2 bug
*
* @param unknown_type $pattern
* @param unknown_type $replacment
* @param unknown_type $source
*/
function _safe_preg_replace( $pattern, $replacment, $source )
{
$temp = preg_replace($pattern,$replacment,$source);
return ($temp==null)?$source:$temp;
}
I just replace the preg_replace call by this new function so that my argument is no more trashed.
I hope it will help.
Arnaud
