VisualEditorHooks: Use the enabledForUser() helper method more

Change-Id: I9ec8a88ea8f0545e16dc1488d52f43c8ce7a93fe
This commit is contained in:
Bartosz Dziewoński 2020-06-08 20:01:04 +02:00
parent 4d396b5dc9
commit af719282b9

View file

@ -474,12 +474,7 @@ class VisualEditorHooks {
}
// Exit if the user doesn't have VE enabled
if (
!$user->getOption( 'visualeditor-enable' ) ||
$user->getOption( 'visualeditor-betatempdisable' ) ||
$user->getOption( 'visualeditor-autodisable' ) ||
( $config->get( 'VisualEditorDisableForAnons' ) && $user->isAnon() )
) {
if ( !self::enabledForUser( $user ) ) {
return;
}
@ -648,12 +643,7 @@ class VisualEditorHooks {
$user = $skin->getUser();
// Exit if the user doesn't have VE enabled
if (
!$user->getOption( 'visualeditor-enable' ) ||
$user->getOption( 'visualeditor-betatempdisable' ) ||
$user->getOption( 'visualeditor-autodisable' ) ||
( $config->get( 'VisualEditorDisableForAnons' ) && $user->isAnon() )
) {
if ( !self::enabledForUser( $user ) ) {
return;
}