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:
aude 2016-07-14 15:42:59 -04:00
parent c39fb397d2
commit 7ec0c426b3

View file

@ -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;
}