Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/misc/cron/archive.php mistake web execution for command line #6013

Closed
Riimu opened this issue Aug 16, 2014 · 0 comments
Closed

/misc/cron/archive.php mistake web execution for command line #6013

Riimu opened this issue Aug 16, 2014 · 0 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@Riimu
Copy link

Riimu commented Aug 16, 2014

The archive.php in 2.5.0 now uses the following condition to check if the script has been run from command line:

if (isset($_SERVER['argv'])) {

Please be aware, that $_SERVER['argv'] may be set on some web environments (such as cgi or php-fpm, I believe). Thus, the script will fail (or rather, display an empty page) on any web environment that sets that particular value, because it tries to run the web archival script as if it was run from a command line. It would probably be more advisable to validate the running environment using PHP_SAPI or php_sapi_name().

@tsteur tsteur added the Bug label Aug 18, 2014
@tsteur tsteur added this to the Piwik 2.6.0 milestone Aug 18, 2014
@tsteur tsteur self-assigned this Aug 18, 2014
tsteur added a commit that referenced this issue Aug 19, 2014
…I. In type CGI the argv should not be registered anyway unless maybe for instance register-argc-argv is enabled
tsteur added a commit that referenced this issue Aug 19, 2014
refs #6013 use console only if executed from cli
@tsteur tsteur closed this as completed Aug 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants