summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2012-07-17 14:50:07 -0700
committerStanislav Malyshev <stas@php.net>2012-07-17 14:50:07 -0700
commita66b5c9a289f5bfc392e1fd9ae13981e84a465ac (patch)
tree3857ebdbbeada02eca50c2e541c0b175b8dc9f98
parentda4e5307b9e8c083182f6d0c09fd9b272dd38932 (diff)
downloadphp-git-a66b5c9a289f5bfc392e1fd9ae13981e84a465ac.tar.gz
Revert "Fix bug #62112: number_format() is not binary safe"
This reverts commit 3e62aae1b456440328af4153524e22679b84f68a.
-rw-r--r--ext/standard/math.c20
-rw-r--r--ext/standard/tests/math/bug62112.phptbin143 -> 0 bytes
2 files changed, 2 insertions, 18 deletions
diff --git a/ext/standard/math.c b/ext/standard/math.c
index b3e8c6f086..65187f6fa1 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -1097,9 +1097,7 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho
return _php_math_number_format_ex(d, dec, &dec_point, 1, &thousand_sep, 1);
}
-static char *_php_math_number_format_ex_len(double d, int dec, char *dec_point,
- size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len,
- int *result_len)
+PHPAPI char *_php_math_number_format_ex(double d, int dec, char *dec_point, size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len)
{
char *tmpbuf = NULL, *resbuf;
char *s, *t; /* source, target */
@@ -1207,19 +1205,8 @@ static char *_php_math_number_format_ex_len(double d, int dec, char *dec_point,
efree(tmpbuf);
- if (result_len) {
- *result_len = reslen;
- }
-
return resbuf;
}
-
-PHPAPI char *_php_math_number_format_ex(double d, int dec, char *dec_point,
- size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len)
-{
- return _php_math_number_format_ex_len(d, dec, dec_point, dec_point_len,
- thousand_sep, thousand_sep_len, NULL);
-}
/* }}} */
/* {{{ proto string number_format(float number [, int num_decimal_places [, string dec_seperator, string thousands_seperator]])
@@ -1254,10 +1241,7 @@ PHP_FUNCTION(number_format)
thousand_sep_len = 1;
}
- Z_TYPE_P(return_value) = IS_STRING;
- Z_STRVAL_P(return_value) = _php_math_number_format_ex_len(num, dec,
- dec_point, dec_point_len, thousand_sep, thousand_sep_len,
- &Z_STRLEN_P(return_value));
+ RETURN_STRING(_php_math_number_format_ex(num, dec, dec_point, dec_point_len, thousand_sep, thousand_sep_len), 0);
break;
default:
WRONG_PARAM_COUNT;
diff --git a/ext/standard/tests/math/bug62112.phpt b/ext/standard/tests/math/bug62112.phpt
deleted file mode 100644
index 01de35a9c5..0000000000
--- a/ext/standard/tests/math/bug62112.phpt
+++ /dev/null
Binary files differ