Merge changes I310e638a,I397ac16a

* changes:
  hooks: Only check relevant page title instead of both
  Don't set ignoreHidden=true when calling User::getOption
This commit is contained in:
jenkins-bot 2013-07-23 18:04:06 +00:00 committed by Gerrit Code Review
commit bf342d660c

View file

@ -62,22 +62,13 @@ class VisualEditorHooks {
!$skin->getTitle()->isRedirect() &&
// User has the 'visualeditor-enable' preference set
$skin->getUser()->getOption(
'visualeditor-enable',
/*default=*/ false,
// HACK: Allows us to suppress the option in preferences when it's on for all.
/*ignoreHidden=*/ true
) &&
$skin->getUser()->getOption( 'visualeditor-enable' ) &&
// The user's current skin is supported
in_array( $skin->getSkinName(), self::$supportedSkins ) &&
(
// Article in the VisualEditor namespace
in_array( $skin->getTitle()->getNamespace(), $wgVisualEditorNamespaces ) ||
// Special page action for an article in the VisualEditor namespace
in_array( $skin->getRelevantTitle()->getNamespace(), $wgVisualEditorNamespaces )
) &&
// The current page is in a VisualEditor-enabled namespace
in_array( $skin->getRelevantTitle()->getNamespace(), $wgVisualEditorNamespaces ) &&
// Only use VisualEditor if the page is wikitext, not CSS/JS
$skin->getTitle()->getContentModel() === CONTENT_MODEL_WIKITEXT