From: Ilia Alshanetsky Date: Tue, 17 Jun 2003 13:20:18 +0000 (+0000) Subject: Fixed bug #24220 (range() didn't handle numeric strings correctly) X-Git-Tag: php-4.3.3RC1~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7473ff4698dc72cc20b5953581e85680f915be5f;p=php Fixed bug #24220 (range() didn't handle numeric strings correctly) --- diff --git a/ext/standard/array.c b/ext/standard/array.c index 597daf2508..366d35eaf3 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1428,7 +1428,7 @@ PHP_FUNCTION(range) /* allocate an array for return */ array_init(return_value); - if (Z_TYPE_PP(zlow)==IS_STRING && Z_TYPE_PP(zhigh)==IS_STRING) { + if (Z_TYPE_PP(zlow) == IS_STRING && Z_TYPE_PP(zhigh) == IS_STRING && Z_STRLEN_PP(zlow) == 1 && Z_STRLEN_PP(zhigh) == 1) { unsigned char low, high; low = *((unsigned char *)Z_STRVAL_PP(zlow)); high = *((unsigned char *)Z_STRVAL_PP(zhigh));