]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #29226 (ctype_* functions missing validation of numeric
authorIlia Alshanetsky <iliaa@php.net>
Tue, 20 Jul 2004 01:03:18 +0000 (01:03 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 20 Jul 2004 01:03:18 +0000 (01:03 +0000)
string representations).

ext/ctype/ctype.c

index 0e7e4699bd1ea94cba987911069af7a8980d7fbd..db88978eb593c3148d41730b5db1a8cf00525e5e 100644 (file)
@@ -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; \