Created
March 14, 2012 19:31
-
-
Save anonymous/2038870 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: ext/standard/string.c | |
=================================================================== | |
--- ext/standard/string.c (revision 324248) | |
+++ ext/standard/string.c (working copy) | |
@@ -4201,7 +4201,7 @@ | |
} | |
/* }}} */ | |
-/* {{{ proto void parse_str(string encoded_string [, array result]) | |
+/* {{{ proto void parse_str(string encoded_string [, array result [, int max_vars]]) | |
Parses GET/POST/COOKIE data and sets global variables */ | |
PHP_FUNCTION(parse_str) | |
{ | |
@@ -4209,13 +4209,19 @@ | |
zval *arrayArg = NULL; | |
char *res = NULL; | |
int arglen; | |
+ long max_vars; | |
+ long old_max_vars = PG(max_input_vars); | |
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &arg, &arglen, &arrayArg) == FAILURE) { | |
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zl", &arg, &arglen, &arrayArg, &max_vars) == FAILURE) { | |
return; | |
} | |
res = estrndup(arg, arglen); | |
+ if (max_vars != old_max_vars) { | |
+ PG(max_input_vars) = max_vars; | |
+ } | |
+ | |
if (arrayArg == NULL) { | |
zval tmp; | |
@@ -4233,6 +4239,10 @@ | |
zval_dtor(arrayArg); | |
ZVAL_COPY_VALUE(arrayArg, &ret); | |
} | |
+ | |
+ if (max_vars != old_max_vars) { | |
+ PG(max_input_vars) = old_max_vars; | |
+ } | |
} | |
/* }}} */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment