summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2004-03-12 17:42:09 +0000
committerRasmus Lerdorf <rasmus@php.net>2004-03-12 17:42:09 +0000
commit8b9cc5ba8109d0232e47ae398e366b29f5ca5932 (patch)
tree0809b2cdbfb2424723c9370c71cf8053515059ef
parent259a07f73302430b0580c2752088c207dc9841d5 (diff)
downloadphp-git-8b9cc5ba8109d0232e47ae398e366b29f5ca5932.tar.gz
MFH
getopt() doesn't work if variables_order does not include "S" because it only looks in $_SERVER for argv. So, if we don't find argv in $_SERVER fall back to looking in the global symbol table where register_argc_argv would have put it.
-rw-r--r--ext/standard/basic_functions.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 96ea2679f0..c2e6ad9403 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -1442,8 +1442,8 @@ PHP_FUNCTION(getopt)
* in order to be on the safe side, even though it is also available
* from the symbol table.
*/
- if (zend_hash_find(HASH_OF(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"),
- (void **) &args) != FAILURE) {
+ if (zend_hash_find(HASH_OF(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"), (void **) &args) != FAILURE ||
+ zend_hash_find(&EG(symbol_table), "argv", sizeof("argv"), (void **) &args) != FAILURE) {
int pos = 0;
zval **arg;