From: Ilia Alshanetsky Date: Tue, 20 Jul 2004 01:03:16 +0000 (+0000) Subject: Fixed bug #29226 (ctype_* functions missing validation of numeric string X-Git-Tag: PRE_ZEND_VM_DISPATCH_PATCH~437 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3f7b6242d2dab1d25785a5145a4f5c14aac38ca;p=php Fixed bug #29226 (ctype_* functions missing validation of numeric string representations). --- diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c index 0e7e4699bd..db88978eb5 100644 --- a/ext/ctype/ctype.c +++ b/ext/ctype/ctype.c @@ -97,7 +97,11 @@ PHP_MINFO_FUNCTION(ctype) return; \ switch (Z_TYPE_P(c)) { \ case IS_LONG: \ - RETURN_BOOL(iswhat(Z_LVAL_P(c))); \ + if (Z_LVAL_P(c) < 255 && Z_LVAL_P(c) > -127) { \ + RETURN_BOOL(iswhat(Z_LVAL_P(c))); \ + } \ + SEPARATE_ZVAL(&c); \ + convert_to_string(c); \ case IS_STRING: \ { \ char *p; \