php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | |
Patch inconsistent-bin-hex-handling.patch for Strings related Bug #66399Patch version 2014-01-03 14:13 UTC Return to Bug #66399 | Download this patchThis patch is obsolete Obsoleted by patches: This patch renders other patches obsolete Obsolete patches: Patch Revisions: 2014-01-03 14:25 UTC | 2014-01-03 14:15 UTC | 2014-01-03 14:13 UTC | 2014-01-03 13:39 UTCDeveloper: krakjoe@php.netdiff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index e862929..98d34de 100644 index e862929..ba98ffc 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -79,6 +79,24 @@ static const unsigned char tolower_map[256] = { zend_binary_strncasecmp + if (str[1] != '\0' && str[1] != '\0') { + if (str[1] == 'x' || str[1] == 'X') { + return strtol(&str[2], NULL, 8); + } else { + if (str[1] == 'b' || str[1] == 'B') { + if (str[1] == 'b') { + return strtol(&str[2], NULL, 2); + } + } + } } /* Skip any leading 0s */ diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c index 4546614..0348778 100644 index 4546614..f6abb49 100644 --- a/Zend/zend_strtod.c +++ b/Zend/zend_strtod.c @@ -2063,7 +2063,7 @@ ZEND_API double zend_strtod (CONST char *s00, CONST char **se) } else if (*s == '+') { + if (*s == '\0') { s = s00; goto ret; @@ -2074,7 +2074,16 @@ ZEND_API double zend_strtod (CONST char *s00, CONST char **se) @@ -2074,7 +2074,18 @@ ZEND_API double zend_strtod (CONST char *s00, CONST char **se) while(*++s == '0') ; if (!*s) goto ret; + + if (*s == 'x' || *s == 'X') { + if (s[1] != '\0') + if (s[1] != '\0') { + return zend_hex_strtod(&s[1], se); + } + } else if (*s == 'b' || *s == 'B') { + if (s[1] != '\0') + if (s[1] != '\0') { + return zend_bin_strtod(&s[1], se); + } + } } + s0 = s; |
Copyright © 2001-2024 The PHP Group All rights reserved. |
Last updated: Fri Apr 26 15:01:56 2024 UTC |