Skip to content

Commit

Permalink
Fixed bug #77608
Browse files Browse the repository at this point in the history
Remove special handling of doubles and escape them as usual instead.
  • Loading branch information
nikic committed Feb 12, 2019
1 parent b5cb3ac commit 8e34de4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ PHP NEWS
- Standard:
. Fixed bug #77552 (Unintialized php_stream_statbuf in stat functions).
(John Stevenson)
. Fixed bug #77608 (http_build_query doesn't encode "+" in a float number).
(Nikita)

07 Feb 2019, PHP 7.2.15

Expand Down
9 changes: 0 additions & 9 deletions ext/standard/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,6 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
case IS_TRUE:
smart_str_appendl(formstr, "1", sizeof("1")-1);
break;
case IS_DOUBLE:
{
char *ekey;
size_t ekey_len;
ekey_len = spprintf(&ekey, 0, "%.*G", (int) EG(precision), Z_DVAL_P(zdata));
smart_str_appendl(formstr, ekey, ekey_len);
efree(ekey);
}
break;
default:
{
zend_string *ekey;
Expand Down
11 changes: 11 additions & 0 deletions ext/standard/tests/strings/bug77608.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--TEST--
Bug #77608: http_build_query doesn't encode "+" in a float number
--FILE--
<?php

$a = ["x" => 1E+14, "y" => "1E+14"];
echo http_build_query($a);

?>
--EXPECT--
x=1.0E%2B14&y=1E%2B14

0 comments on commit 8e34de4

Please sign in to comment.