Would be nice if this was fixed in HEAD too.

    --Jani
    


On Mon, 31 Mar 2003, Brian France wrote:

>bfrance                Mon Mar 31 16:24:59 2003 EDT
>
>  Modified files:              (Branch: PHP_4_3)
>    /php4/main main.c 
>  Log:
>  
>       Fixes the problem where argv and argc are not populated unless S 
>       is in the variables_order, even if register_argc_argv is on.
>  
>  
>  
>Index: php4/main/main.c
>diff -u php4/main/main.c:1.512.2.20 php4/main/main.c:1.512.2.21
>--- php4/main/main.c:1.512.2.20        Wed Mar 19 03:22:35 2003
>+++ php4/main/main.c   Mon Mar 31 16:24:59 2003
>@@ -18,7 +18,7 @@
>    +----------------------------------------------------------------------+
> */
> 
>-/* $Id: main.c,v 1.512.2.20 2003/03/19 08:22:35 sniper Exp $ */
>+/* $Id: main.c,v 1.512.2.21 2003/03/31 21:24:59 bfrance Exp $ */
> 
> /* {{{ includes
>  */
>@@ -110,7 +110,7 @@
> 
> static last_error_type last_error;
> 
>-static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC);
>+static void php_build_argv(char *s TSRMLS_DC);
> 
> 
> static char *short_track_vars_names[] = {
>@@ -1317,11 +1317,6 @@
>               sapi_module.register_server_variables(array_ptr TSRMLS_CC);
>       }
> 
>-      /* argv/argc support */
>-      if (PG(register_argc_argv)) {
>-              php_build_argv(SG(request_info).query_string, array_ptr TSRMLS_CC);
>-      }
>-
>       /* PHP Authentication support */
>       if (SG(request_info).auth_user) {
>               php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, 
> array_ptr TSRMLS_CC);
>@@ -1423,6 +1418,11 @@
>               php_register_server_variables(TSRMLS_C);
>       }
> 
>+      /* argv/argc support */
>+      if (PG(register_argc_argv)) {
>+              php_build_argv(SG(request_info).query_string TSRMLS_CC);
>+      }
>+
>       for (i=0; i<NUM_TRACK_VARS; i++) {
>               if (!PG(http_globals)[i]) {
>                       if (!initialized_dummy_track_vars_array) {
>@@ -1474,7 +1474,7 @@
> 
> /* {{{ php_build_argv
>  */
>-static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC)
>+static void php_build_argv(char *s TSRMLS_DC)
> {
>       pval *arr, *argc, *tmp;
>       int count = 0;
>@@ -1544,8 +1544,10 @@
>               zend_hash_add(&EG(symbol_table), "argc", sizeof("argc"), &argc, 
> sizeof(zval *), NULL);
>       }
> 
>-      zend_hash_update(Z_ARRVAL_P(track_vars_array), "argv", sizeof("argv"), &arr, 
>sizeof(pval *), NULL);
>-      zend_hash_update(Z_ARRVAL_P(track_vars_array), "argc", sizeof("argc"), &argc, 
>sizeof(pval *), NULL);
>+      if ( PG(http_globals)[TRACK_VARS_SERVER] != NULL ) {
>+              zend_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), 
>"argv", sizeof("argv"), &arr, sizeof(pval *), NULL);
>+              zend_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), 
>"argc", sizeof("argc"), &argc, sizeof(pval *), NULL);
>+      }
> }
> /* }}} */
> 
>
>
>
>

-- 
<- For Sale! ->


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

Reply via email to