mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-15 03:33:45 +00:00
Get user from context instead of global
DifferenceEngine extends ContextSource, so we can get the user from there instead of using a global. Change-Id: I46e7a244729f2d8259319bed2c905e2971b37bf0
This commit is contained in:
parent
c39fb397d2
commit
7ec0c426b3
|
@ -15,15 +15,13 @@ class RevisionSliderHooks {
|
|||
Revision $oldRev,
|
||||
Revision $newRev
|
||||
) {
|
||||
global $wgUser;
|
||||
|
||||
/**
|
||||
* If this extension is deployed with the BetaFeatures extension then require the
|
||||
* current user to have it enabled as a BetaFeature.
|
||||
*/
|
||||
if (
|
||||
class_exists( BetaFeatures::class ) &&
|
||||
!BetaFeatures::isFeatureEnabled( $wgUser, 'revisionslider' ) )
|
||||
!BetaFeatures::isFeatureEnabled( $diff->getUser(), 'revisionslider' ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue