EventBusHooks::onArticleRevisionVisibilitySet should not create global functions
Closed, ResolvedPublic

Description

In the mediawiki/extensions/EventBus repository, there's a class called EventBusHooks, that has a function, onArticleRevisionVisibilitySet, which likely unintentionally creates new global functions.

In PHP, creating a function inside a class static function actually creates a global function (unlike JavaScript). https://3v4l.org/7tNtb

This should be switched to having private static helper functions instead of creating new global functions.

I'll mentor this for Google-Code-in-2017

Legoktm created this task.Dec 27 2017, 10:25 PM
Restricted Application added a project: Analytics. · View Herald TranscriptDec 27 2017, 10:25 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
nikitavbv added a subscriber: nikitavbv.

I will fix this issue!

By the way, I noticed that function onBlockIpComplete unintentionally creates new global function too. This will be also fixed in my patch.

Change 400571 had a related patch set uploaded (by Phantom42; owner: Phantom42):
[mediawiki/extensions/EventBus@master] Fix unintentionally created global functions in EventBusHooks

https://gerrit.wikimedia.org/r/400571

Change 400571 merged by jenkins-bot:
[mediawiki/extensions/EventBus@master] Fix unintentionally created global functions in EventBusHooks

https://gerrit.wikimedia.org/r/400571

Legoktm closed this task as Resolved.Dec 28 2017, 8:10 PM
In T183730#3862416, @Phantom42 wrote:

By the way, I noticed that function onBlockIpComplete unintentionally creates new global function too. This will be also fixed in my patch.

Awesome, thanks for taking care of that too!