diff options
author | George Peter Banyard <girgias@php.net> | 2020-09-21 15:33:23 +0100 |
---|---|---|
committer | George Peter Banyard <girgias@php.net> | 2020-09-21 16:29:10 +0100 |
commit | 2b6f5eec6c3d2b0596f7376ec41b316d1c4ac4e7 (patch) | |
tree | 940d49d53e15cac7eb654dc64552e34cb1700a14 | |
parent | 8ff2f2f84b2c0ea33b38f7e98aaa710ce4f3fc91 (diff) | |
download | php-git-2b6f5eec6c3d2b0596f7376ec41b316d1c4ac4e7.tar.gz |
Drop Hex support in numeric strings for Intl collator
Support for this was removed in PHP 7.0.
See: https://wiki.php.net/rfc/remove_hex_support_in_numeric_strings
-rw-r--r-- | ext/intl/collator/collator_is_numeric.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/ext/intl/collator/collator_is_numeric.c b/ext/intl/collator/collator_is_numeric.c index 6f7311fa96..553b9d11ed 100644 --- a/ext/intl/collator/collator_is_numeric.c +++ b/ext/intl/collator/collator_is_numeric.c @@ -212,19 +212,13 @@ zend_uchar collator_is_numeric( UChar *str, int32_t length, zend_long *lval, dou zend_long local_lval; double local_dval; UChar *end_ptr_long, *end_ptr_double; - int conv_base=10; if (!length) { return 0; } - /* handle hex numbers */ - if (length>=2 && str[0]=='0' && (str[1]=='x' || str[1]=='X')) { - conv_base=16; - } - errno=0; - local_lval = collator_u_strtol(str, &end_ptr_long, conv_base); + local_lval = collator_u_strtol(str, &end_ptr_long, 10); if (errno != ERANGE) { if (end_ptr_long == str+length) { /* integer string */ if (lval) { @@ -238,11 +232,6 @@ zend_uchar collator_is_numeric( UChar *str, int32_t length, zend_long *lval, dou end_ptr_long = NULL; } - if (conv_base == 16) { /* hex string, under UNIX strtod() messes it up */ - /* UTODO: keep compatibility with is_numeric_string() here? */ - return 0; - } - local_dval = collator_u_strtod(str, &end_ptr_double); if (local_dval == 0 && end_ptr_double == str) { end_ptr_double = NULL; |