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

Fix #44 (addMatomo being called twice) #45

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bitsofmymind
Copy link

Here is the pull request to fix #44.

// Fix #44. This function is being called twice from OutputPage (seems to be an upstream bug).
static $called = false;

if($called) { return; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will $called ever be anything other than false at this point? It looks like this will never return early.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In PHP a static variable defined in a function only exists within that function (or method in this case) but does not lose its value upon the function returning. See https://www.php.net/manual/en/language.variables.scope.php#language.variables.scope.static

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

addMatomo() called twice
2 participants