summaryrefslogtreecommitdiff
path: root/ext/standard/http.c
diff options
context:
space:
mode:
authorSara Golemon <pollita@php.net>2003-09-06 05:41:36 +0000
committerSara Golemon <pollita@php.net>2003-09-06 05:41:36 +0000
commit79ad5802a50f39aa37b7ad8c1bd6975ad4fead03 (patch)
tree255e8e15d260e6c720689032ad843f41720069f1 /ext/standard/http.c
parentfba7705c9988933c9544d70871f95a3937be925f (diff)
downloadphp-git-79ad5802a50f39aa37b7ad8c1bd6975ad4fead03.tar.gz
Prevent Recursion
Diffstat (limited to 'ext/standard/http.c')
-rw-r--r--ext/standard/http.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/standard/http.c b/ext/standard/http.c
index 8991cd1075..b949fd3dc7 100644
--- a/ext/standard/http.c
+++ b/ext/standard/http.c
@@ -39,6 +39,11 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
return FAILURE;
}
+ if (ht->nApplyCount > 0) {
+ /* Prevent Recuriosn */
+ return SUCCESS;
+ }
+
arg_sep = INI_STR("arg_separator.output");
if (!arg_sep || !strlen(arg_sep)) {
arg_sep = URL_DEFAULT_ARG_SEP;
@@ -106,7 +111,9 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
*(p++) = '[';
*p = '\0';
}
+ ht->nApplyCount++;
php_url_encode_hash_ex(Z_ARRVAL_PP(zdata), formstr, NULL, 0, newprefix, newprefix_len, "]", 1 TSRMLS_CC);
+ ht->nApplyCount--;
efree(newprefix);
} else {
if (formstr->len) {