From 900b772ed89492be9833a4c7f6570c0dea49cfb4 Mon Sep 17 00:00:00 2001 From: Fomafix Date: Thu, 18 Sep 2014 21:00:52 +0000 Subject: [PATCH] Set mw.config wgFileCanRotate only on Special:Upload instead of site-wide UploadWizard also uses wgFileCanRotate and set the variable by I3c50b56e6a11742cfc1c02d3d8dbeb0c151b0e91 itself. Change-Id: Iff6a952c8f4f21c0e27bd6b4191f3b0b453eec03 --- RELEASE-NOTES-1.25 | 1 + includes/resourceloader/ResourceLoaderStartUpModule.php | 3 --- includes/specials/SpecialUpload.php | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 index 3f91520327..c935ffeb39 100644 --- a/RELEASE-NOTES-1.25 +++ b/RELEASE-NOTES-1.25 @@ -26,6 +26,7 @@ changes to languages because of Bugzilla reports. * The skin autodiscovery mechanism, deprecated in MediaWiki 1.23, has been removed. See https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery for migration guide for creators and users of custom skins that relied on it. +* Javascript variable 'wgFileCanRotate' now only available on Special:Upload. == Compatibility == diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 78fe8e0186..2f3d3f8975 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -92,9 +92,6 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { 'wgSiteName' => $conf->get( 'Sitename' ), 'wgFileExtensions' => array_values( array_unique( $conf->get( 'FileExtensions' ) ) ), 'wgDBname' => $conf->get( 'DBname' ), - // This sucks, it is only needed on Special:Upload, but I could - // not find a way to add vars only for a certain module - 'wgFileCanRotate' => SpecialUpload::rotationEnabled(), 'wgAvailableSkins' => Skin::getSkinNames(), 'wgExtensionAssetsPath' => $conf->get( 'ExtensionAssetsPath' ), // MediaWiki sets cookies to have this prefix by default diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 55d09dd6d0..51dd7bd10b 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -1142,6 +1142,7 @@ class UploadForm extends HTMLForm { 'wgStrictFileExtensions' => $config->get( 'StrictFileExtensions' ), 'wgCapitalizeUploads' => MWNamespace::isCapitalized( NS_FILE ), 'wgMaxUploadSize' => $this->mMaxUploadSize, + 'wgFileCanRotate' => SpecialUpload::rotationEnabled(), ); $out = $this->getOutput(); -- 2.20.1