]> granicus.if.org Git - php/commitdiff
Prevent Recursion
authorSara Golemon <pollita@php.net>
Sat, 6 Sep 2003 05:41:36 +0000 (05:41 +0000)
committerSara Golemon <pollita@php.net>
Sat, 6 Sep 2003 05:41:36 +0000 (05:41 +0000)
ext/standard/http.c

index 8991cd1075c314bb66590634027fd9a5b5e60e39..b949fd3dc7ca0049e4e56e8949ae39ca4fd50bd8 100644 (file)
@@ -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) {