Skip to content

Commit 8e34de4

Browse files
committed
Fixed bug #77608
Remove special handling of doubles and escape them as usual instead.
1 parent b5cb3ac commit 8e34de4

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ PHP NEWS
2020
- Standard:
2121
. Fixed bug #77552 (Unintialized php_stream_statbuf in stat functions).
2222
(John Stevenson)
23+
. Fixed bug #77608 (http_build_query doesn't encode "+" in a float number).
24+
(Nikita)
2325

2426
07 Feb 2019, PHP 7.2.15
2527

ext/standard/http.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,6 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
192192
case IS_TRUE:
193193
smart_str_appendl(formstr, "1", sizeof("1")-1);
194194
break;
195-
case IS_DOUBLE:
196-
{
197-
char *ekey;
198-
size_t ekey_len;
199-
ekey_len = spprintf(&ekey, 0, "%.*G", (int) EG(precision), Z_DVAL_P(zdata));
200-
smart_str_appendl(formstr, ekey, ekey_len);
201-
efree(ekey);
202-
}
203-
break;
204195
default:
205196
{
206197
zend_string *ekey;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--TEST--
2+
Bug #77608: http_build_query doesn't encode "+" in a float number
3+
--FILE--
4+
<?php
5+
6+
$a = ["x" => 1E+14, "y" => "1E+14"];
7+
echo http_build_query($a);
8+
9+
?>
10+
--EXPECT--
11+
x=1.0E%2B14&y=1E%2B14

0 commit comments

Comments
 (0)