mirror of
https://github.com/php/php-src.git
synced 2025-08-20 01:14:28 +02:00
Fixed register_argc_argv
This commit is contained in:
parent
c6b425432a
commit
fb7324bb71
3 changed files with 3 additions and 9 deletions
|
@ -639,7 +639,7 @@ static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC)
|
|||
int count = 0;
|
||||
char *ss, *space;
|
||||
|
||||
if (!(SG(request_info).argc || track_vars_array)) {
|
||||
if (!(SG(request_info).argc || (s && *s))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -696,7 +696,7 @@ static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC)
|
|||
argc->is_ref = 0;
|
||||
argc->refcount = 0;
|
||||
|
||||
if (SG(request_info).argc) {
|
||||
if (Z_LVAL_P(argc)) {
|
||||
arr->refcount++;
|
||||
argc->refcount++;
|
||||
zend_hash_update(&EG(symbol_table), "argv", sizeof("argv"), &arr, sizeof(zval *), NULL);
|
||||
|
|
|
@ -8,16 +8,9 @@ register_argc_argv=1
|
|||
ab+cd+ef+123+test
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
if (!ini_get('register_globals')) {
|
||||
$argc = $_SERVER['argc'];
|
||||
$argv = $_SERVER['argv'];
|
||||
}
|
||||
|
||||
for ($i=0; $i<$argc; $i++) {
|
||||
echo "$i: ".$argv[$i]."\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
0: ab
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
Bug #29971 (variables_order behaviour)
|
||||
--INI--
|
||||
variables_order=GPC
|
||||
register_argc_argv=0
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump($_ENV,$_SERVER);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue