WebApp Sec mailing list archives

Re: PHP variable sanitization functions


From: Jan Pieter Kunst <jpk () akamail com>
Date: Wed, 27 Aug 2003 04:56:05 +0200

function check_integer($integer, $extras='') {
        if (!is_integer($integer)) {
                $this->set_error("Type not integer");
                return FALSE;
        }

[...]

}


But see this note from the PHP documentation regarding is_integer() or is_int():
<http://nl3.php.net/manual/en/function.is-int.php>:

"Note: To test if a variable is a number or a numeric string (such as form input, which is always a string), you must use is_numeric() ."

JP


Current thread: