rasmus          Fri Mar 12 12:42:10 2004 EDT

  Modified files:              (Branch: PHP_4_3)
    /php-src/ext/standard       basic_functions.c 
  Log:
  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.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/basic_functions.c?r1=1.543.2.31&r2=1.543.2.32&ty=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.543.2.31 
php-src/ext/standard/basic_functions.c:1.543.2.32
--- php-src/ext/standard/basic_functions.c:1.543.2.31   Mon Jan 19 14:07:08 2004
+++ php-src/ext/standard/basic_functions.c      Fri Mar 12 12:42:09 2004
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: basic_functions.c,v 1.543.2.31 2004/01/19 19:07:08 sniper Exp $ */
+/* $Id: basic_functions.c,v 1.543.2.32 2004/03/12 17:42:09 rasmus Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -1442,8 +1442,8 @@
         * 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;
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to