From: Ilia Alshanetsky Date: Fri, 16 Jul 2004 02:03:25 +0000 (+0000) Subject: MFB: Fixed bug #28800 (strings beginning with "inf" improperly converted). X-Git-Tag: PRE_ZEND_VM_DISPATCH_PATCH~494 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6dd2613d7ba7d2a8e34a99e6bfeda44ddb540323;p=php MFB: Fixed bug #28800 (strings beginning with "inf" improperly converted). --- diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index c6182ff6b6..b6b845ae76 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -87,6 +87,8 @@ static inline zend_bool is_numeric_string(char *str, int length, long *lval, dou *lval = local_lval; } return IS_LONG; + } else if (end_ptr_long == str && *end_ptr_long != '\0') { /* ignore partial string matches */ + return 0; } } else { end_ptr_long=NULL; diff --git a/tests/lang/bug28800.phpt b/tests/lang/bug28800.phpt new file mode 100644 index 0000000000..f81ad7fec9 --- /dev/null +++ b/tests/lang/bug28800.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #28800 (Incorrect string to number conversion for strings starting with 'inf') +--FILE-- + +--EXPECT-- +0 +0 +0 +0 +0 +0 +