Mattflaschen has uploaded a new change for review.
https://gerrit.wikimedia.org/r/119077
Change subject: Replace call to deprecated OutputPage->isUserJsAllowed
......................................................................
Replace call to deprecated OutputPage->isUserJsAllowed
Change-Id: I10fdb964ad3bd7815606be2199c8816cb8e5418a
---
M GuidedTourHooks.php
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GuidedTour
refs/changes/77/119077/1
diff --git a/GuidedTourHooks.php b/GuidedTourHooks.php
index 38c7ac2..2f8e155 100644
--- a/GuidedTourHooks.php
+++ b/GuidedTourHooks.php
@@ -125,11 +125,13 @@
private static function addTour( $out, $tourName ) {
global $wgResourceModules;
+ $isUserJsAllowed = $out->getAllowedModules(
ResourceLoaderModule::TYPE_SCRIPTS ) >=
ResourceLoaderModule::ORIGIN_USER_INDIVIDUAL;
+
// Exclude '-' because MediaWiki message keys use it as a
separator after the tourname.
// Exclude '.' because module names use it as a separator.
// "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 ) {
+ if ( $isUserJsAllowed && $tourName !== null && strpbrk(
$tourName, '-.' ) === false ) {
$tourModuleName = "ext.guidedTour.tour.$tourName";
if ( isset( $wgResourceModules[$tourModuleName] ) ) {
// Add the tour itself for extension-defined
tours.
--
To view, visit https://gerrit.wikimedia.org/r/119077
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I10fdb964ad3bd7815606be2199c8816cb8e5418a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GuidedTour
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits