Umherirrender has uploaded a new change for review.
https://gerrit.wikimedia.org/r/65136
Change subject: Avoid changing the global on special pages
......................................................................
Avoid changing the global on special pages
Change-Id: I742845badd43cef68ba9f807030d8ea434961fd4
---
M includes/specials/SpecialRecentchanges.php
M includes/specials/SpecialUpload.php
2 files changed, 12 insertions(+), 10 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/36/65136/1
diff --git a/includes/specials/SpecialRecentchanges.php
b/includes/specials/SpecialRecentchanges.php
index 0d6378c..1b406d1 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -876,16 +876,19 @@
}
# Sort data for display and make sure it's unique after we've
added user data.
- $wgRCLinkLimits[] = $options['limit'];
- $wgRCLinkDays[] = $options['days'];
- sort( $wgRCLinkLimits );
- sort( $wgRCLinkDays );
- $wgRCLinkLimits = array_unique( $wgRCLinkLimits );
- $wgRCLinkDays = array_unique( $wgRCLinkDays );
+ $linkLimits = $wgRCLinkLimits;
+ $linkLimits[] = $options['limit'];
+ sort( $linkLimits );
+ $linkLimits = array_unique( $linkLimits );
+
+ $linkDays = $wgRCLinkDays;
+ $linkDays[] = $options['days'];
+ sort( $linkDays );
+ $linkDays = array_unique( $linkDays );
// limit links
$cl = array();
- foreach ( $wgRCLinkLimits as $value ) {
+ foreach ( $linkLimits as $value ) {
$cl[] = $this->makeOptionsLink( $lang->formatNum(
$value ),
array( 'limit' => $value ), $nondefaults,
$value == $options['limit'] );
}
@@ -893,7 +896,7 @@
// day links, reset 'from' to none
$dl = array();
- foreach ( $wgRCLinkDays as $value ) {
+ foreach ( $linkDays as $value ) {
$dl[] = $this->makeOptionsLink( $lang->formatNum(
$value ),
array( 'days' => $value, 'from' => '' ),
$nondefaults, $value == $options['days'] );
}
diff --git a/includes/specials/SpecialUpload.php
b/includes/specials/SpecialUpload.php
index ee737c6..98d0c9a 100644
--- a/includes/specials/SpecialUpload.php
+++ b/includes/specials/SpecialUpload.php
@@ -456,7 +456,6 @@
*/
public static function getInitialPageText( $comment = '', $license =
'', $copyStatus = '', $source = '' ) {
global $wgUseCopyrightUpload, $wgForceUIMsgAsContentMsg;
- $wgForceUIMsgAsContentMsg = (array) $wgForceUIMsgAsContentMsg;
$msg = array();
/* These messages are transcluded into the actual text of the
description page.
@@ -464,7 +463,7 @@
* instead of hardcoding it there in the uploader language.
*/
foreach ( array( 'license-header', 'filedesc', 'filestatus',
'filesource' ) as $msgName ) {
- if ( in_array( $msgName, $wgForceUIMsgAsContentMsg ) ) {
+ if ( in_array( $msgName,
(array)$wgForceUIMsgAsContentMsg ) ) {
$msg[$msgName] = "{{int:$msgName}}";
} else {
$msg[$msgName] = wfMessage( $msgName
)->inContentLanguage()->text();
--
To view, visit https://gerrit.wikimedia.org/r/65136
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I742845badd43cef68ba9f807030d8ea434961fd4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits