Page MenuHomePhabricator

bug49175.patch

Authored By
bzimport
Nov 22 2014, 1:50 AM
Size
1 KB
Referenced Files
None
Subscribers
None

bug49175.patch

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

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
10771
Default Alt Text
bug49175.patch (1 KB)

Event Timeline