- , .
() :
, (PHP 5.3):
<?php
$arg=$_GET['key'];
if (ereg('^[A-Za-z0-9]+$', $arg) === FALSE){
die('Invalid key');
}
?>
, URL-:
foo.php?key=A%00text
^~~~
when a part texthas anything arbitrarily , which leaves a big security flaw in the code. preg_match()however, does not have this problem. Therefore, you better port your entire code to preg, as it is eregno longer available at all in PHP 6.0.
source
share