jenkins-bot has submitted this change and it was merged.

Change subject: hooks: Only check relevant page title instead of both
......................................................................


hooks: Only check relevant page title instead of both

The relevant page title is equal to the native page title
if we're on a regular page (e.g. both are Foo on Foo and on
Special:MovePage/Foo one is Special:MovePage and the other
Foo). In that case there is no point in checking both, especially
if it is with the OR condition.

Change-Id: I310e638a73312afea421a399ce4c6ea9b4254cbf
---
M VisualEditor.hooks.php
1 file changed, 2 insertions(+), 6 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index 3d55ffd..e39fb91 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -67,12 +67,8 @@
                        // 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

-- 
To view, visit https://gerrit.wikimedia.org/r/75141
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I310e638a73312afea421a399ce4c6ea9b4254cbf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to