Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F11307
bug49175.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 22 2014, 1:50 AM
2014-11-22 01:50:46 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
bug49175.patch
View Options
diff --git a/GuidedTourHooks.php b/GuidedTourHooks.php
index a61ac4f..a55a244 100644
--- a/GuidedTourHooks.php
+++ b/GuidedTourHooks.php
@@ -72,6 +72,8 @@ class GuidedTourHooks {
/**
* Adds a built-in or wiki tour.
*
+ * If user JS is disallowed on this page, it does nothing.
+ *
* If the built-in one exists as a module, it will add that.
*
* Otherwise, it will add the general guided tour module, which will take care of
@@ -89,7 +91,10 @@ class GuidedTourHooks {
// Exclude '-' because MediaWiki message keys use it as a separator after the tourname.
// Exclude '.' because module names use it as a separator.
- if ( $tourName !== NULL && strpbrk( $tourName, '-.' ) === FALSE ) {
+
+ // "User JS" refers to on-wiki JavaScript. In theory we could still add
+ // extension-defined tours, but it's more conservative not to.
+ if ( $out->isUserJsAllowed() && $tourName !== NULL && strpbrk( $tourName, '-.' ) === FALSE ) {
$tourModuleName = "ext.guidedTour.tour.$tourName";
if ( isset ( $wgResourceModules[$tourModuleName] ) ) {
// Add the tour itself for extension-defined tours.
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
10771
Default Alt Text
bug49175.patch (1 KB)
Attached To
Mode
T51175: GuidedTour adds MW namespace scripts to login page
Attached
Detach File
Event Timeline
Log In to Comment