Last modified: 2014-04-29 15:36:29 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T54129, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 52129 - Globals should be explicitly declared in PHP
Globals should be explicitly declared in PHP
Status: NEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.22.0
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-27 01:04 UTC by Adam Wight
Modified: 2014-04-29 15:36 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Adam Wight 2013-07-27 01:04:06 UTC
I've probably chosen the worst possible file as an example, but see this patch: https://gerrit.wikimedia.org/r/#/c/76208/

When MediaWiki source files declare variables in their top-level scope, the implicit assumption is that we are declaring them as global.  However, if any part of the MediaWiki initialization code was called from within local (function-level) scope, PHP will no longer globally scope these variables.

The only solution is to explicitly declare the variables with a top-level "global", anywhere we expect to refer to the variable from another file, i.e., for every global.
Comment 1 Andre Klapper 2013-08-27 09:44:01 UTC
[removing patch-need-review keyword (meant for patches attached in Bugzilla)]
Comment 2 Andre Klapper 2014-04-29 15:36:29 UTC
Patch was abandoned.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links