View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0016882||phpList 3 application||Command Line||public||20-09-13 15:16||26-09-13 14:09|
|Target Version||3.0.X||Fixed in Version||3.0.4|
|Summary||0016882: cli break|
$GLOBALS["argv"] must be replaced with $_SERVER["argv"]
|Tags||No tags attached.|
||not necessarily. http://php.net/manual/en/reserved.variables.argv.php|
||in my configuration $GLOBALS["argv"] is empty... I don't know where it is overwritten|
can you give more arguments for this change? For example argv is being removed from PHP from version X onwards?
I guess it could include some detection of register_argc_argv and give an error or warning when it is not enabled.
I have seen this problem a few times when trying to get cron jobs working.
In those cases php cli was running with register_globals on instead of the cli default of off.
The workaround that I use is to add an option to the command,
It is not clear to me, from the php documentation, why register_globals should affect argc and argv.
Ah, that might be the "unregister_globals" kicking in. For security, if register globals is on, they are all unregistered. But of a workaround for a major PHP insecurity, which I think is no longer valid, or at least is on the list to be obsoleted.
make sure register_globals is off
register-argc-argv is on
overload, can you verify this is the case, and the cause of this issue?
Sorry, I'm new to mantis...
Yes: the case is "register_globals is on" and the function unregister_GLOBALS() set $GLOBALS["argv"] to null
on line 21 (admin/index.php) $_SERVER['argv'] is used, so could be used also in the function parseCline() to avoid problems even if register_globals is on.
In cli use, it is not necessary to unregister_GLOBALS(), because there are no security problems (imho)
yes, I agree on CLI the unregister globals can be avoided. But at the same time, it is now (and has been for quite a few years) generally considered a bad thing to have register globals on, and it's advisable to switch it off.