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

Invalid FastCGI Check in ProxyHttp.php #5064

Closed
anonymous-matomo-user opened this issue May 1, 2014 · 2 comments
Closed

Invalid FastCGI Check in ProxyHttp.php #5064

anonymous-matomo-user opened this issue May 1, 2014 · 2 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.

Comments

@anonymous-matomo-user
Copy link

The FastCGI check in the setHttpStatus function of ProxyHttp.php is invalid.

The function checks the PHP_SAPI global variable for existence of -fcgi in it, but the "if and else" blocks in the check are inverted.

It triggers the code for apache when the string contains -fcgi.

This issue was present in the 2.2.0 branch, and is also present (but in a slightly variated form) in the current master branch.

Fix for Master Branch

Line 224 in ProxyHttp.php changes from:

if (strpos(PHP_SAPI, '-fcgi') !== false) {

to

if (strpos(PHP_SAPI, '-fcgi') === false) {

Fix for 2.2.0 Branch

Line 224 in ProxyHttp.php changes from:

if (substr_compare(PHP_SAPI, '-fcgi', -5)) {

to

if (! substr_compare(PHP_SAPI, '-fcgi', -5)) {
@anonymous-matomo-user
Copy link
Author

Created a pull request 267 on github

@mattab
Copy link
Member

mattab commented May 1, 2014

In 46ff685: Merge pull request #267 from shabeepk/master

Fixes #5064 - Fixing the FastCGI check in setHttpStatus function of ProxyHttp.php file.
Good catch, thanks for the Pull request 👍

sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
Fixing the FastCGI check in setHttpStatus function of ProxyHttp.php file.

Ticket matomo-org#5064
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
Fixes matomo-org#5064 - Fixing the FastCGI check in setHttpStatus function of ProxyHttp.php file.
Good catch, thanks for the Pull request 👍
This issue was closed.
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