mike Wed Mar 8 22:00:21 2006 UTC
Modified files: (Branch: PHP_5_1)
/php-src/ext/standard http.c
/php-src NEWS
Log:
- Fix bug #36656 (http_build_query generates invalid URIs due to use of
square brackets)
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/http.c?r1=1.14.2.3&r2=1.14.2.4&diff_format=u
Index: php-src/ext/standard/http.c
diff -u php-src/ext/standard/http.c:1.14.2.3
php-src/ext/standard/http.c:1.14.2.4
--- php-src/ext/standard/http.c:1.14.2.3 Sun Jan 1 12:50:14 2006
+++ php-src/ext/standard/http.c Wed Mar 8 22:00:21 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: http.c,v 1.14.2.3 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: http.c,v 1.14.2.4 2006/03/08 22:00:21 mike Exp $ */
#include "php_http.h"
#include "php_ini.h"
@@ -82,7 +82,7 @@
if (Z_TYPE_PP(zdata) == IS_ARRAY || Z_TYPE_PP(zdata) ==
IS_OBJECT) {
if (key_type == HASH_KEY_IS_STRING) {
ekey = php_url_encode(key, key_len, &ekey_len);
- newprefix_len = key_suffix_len + ekey_len +
key_prefix_len + 1;
+ newprefix_len = key_suffix_len + ekey_len +
key_prefix_len + 3 /* %5B */;
newprefix = emalloc(newprefix_len + 1);
p = newprefix;
@@ -99,13 +99,14 @@
memcpy(p, key_suffix, key_suffix_len);
p += key_suffix_len;
}
-
- *(p++) = '[';
+ *(p++) = '%';
+ *(p++) = '5';
+ *(p++) = 'B';
*p = '\0';
} else {
/* Is an integer key */
ekey_len = spprintf(&ekey, 12, "%ld", idx);
- newprefix_len = key_prefix_len + num_prefix_len
+ ekey_len + key_suffix_len + 1;
+ newprefix_len = key_prefix_len + num_prefix_len
+ ekey_len + key_suffix_len + 3 /* %5B */;
newprefix = emalloc(newprefix_len + 1);
p = newprefix;
@@ -125,11 +126,13 @@
memcpy(p, key_suffix, key_suffix_len);
p += key_suffix_len;
}
- *(p++) = '[';
+ *(p++) = '%';
+ *(p++) = '5';
+ *(p++) = 'B';
*p = '\0';
}
ht->nApplyCount++;
- php_url_encode_hash_ex(HASH_OF(*zdata), formstr, NULL,
0, newprefix, newprefix_len, "]", 1, (Z_TYPE_PP(zdata) == IS_OBJECT ? *zdata :
NULL), arg_sep TSRMLS_CC);
+ php_url_encode_hash_ex(HASH_OF(*zdata), formstr, NULL,
0, newprefix, newprefix_len, "%5D", 3, (Z_TYPE_PP(zdata) == IS_OBJECT ? *zdata
: NULL), arg_sep TSRMLS_CC);
ht->nApplyCount--;
efree(newprefix);
} else if (Z_TYPE_PP(zdata) == IS_NULL || Z_TYPE_PP(zdata) ==
IS_RESOURCE) {
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.448&r2=1.2027.2.449&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.448 php-src/NEWS:1.2027.2.449
--- php-src/NEWS:1.2027.2.448 Tue Mar 7 19:29:04 2006
+++ php-src/NEWS Wed Mar 8 22:00:21 2006
@@ -48,6 +48,8 @@
- Fixed tiger hash algorithm generating wrong results on big endian platforms.
(Mike)
- Fixed crash with DOMImplementation::createDocumentType("name:"). (Mike)
+- Fixed bug #36656 (http_build_query generates invalid URIs due to use of
+ square brackets). (Mike)
- Fixed bug #36638 (strtotime() returns false when 2nd argument < 1). (Derick)
- Fixed bug #36625 (pg_trace() does not work). (iakio at mono-space dot net)
- Fixed bug #36611 (assignment to SimpleXML object attribute changes argument
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php