Page MenuHomePhabricator

GlobalCssJs needs uses of global $wgUser removed
Open, Needs TriagePublic

Description

See parent task:

The only use is in the removeOldManualUserPages maintenance script, and is accompanied by a comment explaining that it is used to set $wgUser "For hooks not using RequestContext (e.g. AbuseFilter)".

What hooks remain that still need this?

Details

Related Gerrit Patches:
mediawiki/extensions/GlobalCssJs : masterRemove use of global $wgUser

Event Timeline

DannyS712 added a subscriber: Daimona.

@Daimona does AbuseFilter still require this?

DannyS712 moved this task from Unsorted to Next on the User-DannyS712 board.

@Daimona does AbuseFilter still require this?

No. Most usages of $wgUser were removed with r460335.

Nowadays, AF only needs $wgUser to compute old_wikitext and new_wikitext for a RecentChanges row [1], which is unrelated to what that script is doing. However, that doesn't exclude other hook handlers (in other extensions) needing $wgUser. In general, all code that *writes* to $wgUser should be removed last.

[1] - Which in turn is blocked on a huge amount of tech debt, outlined at T213006.

Krinkle removed a subscriber: Krinkle.Jan 5 2020, 1:19 AM

Looking at current hook handlers, I don't see any that use $wgUser

Change 569396 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/GlobalCssJs@master] Remove use of global $wgUser

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