McIntireEvan has uploaded a new change for review.
https://gerrit.wikimedia.org/r/182136
Change subject: Use config values instead of globals in getInitialPageText()
......................................................................
Use config values instead of globals in getInitialPageText()
Replace the use of globals $wgForceUIMsgAsContentMsg and
$wgUseCopyrightUpload with getting them from the Config object
Change-Id: Ie17f7264096cd5fd4a45aafa0469a4a33709860b
---
M includes/specials/SpecialUpload.php
1 file changed, 2 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/36/182136/1
diff --git a/includes/specials/SpecialUpload.php
b/includes/specials/SpecialUpload.php
index 708d469..c88c38f 100644
--- a/includes/specials/SpecialUpload.php
+++ b/includes/specials/SpecialUpload.php
@@ -492,27 +492,24 @@
* @param string $copyStatus
* @param string $source
* @return string
- * @todo Use Config obj instead of globals
*/
public static function getInitialPageText( $comment = '', $license = '',
$copyStatus = '', $source = ''
) {
- global $wgUseCopyrightUpload, $wgForceUIMsgAsContentMsg;
-
$msg = array();
/* These messages are transcluded into the actual text of the
description page.
* Thus, forcing them as content messages makes the upload to
produce an int: template
* instead of hardcoding it there in the uploader language.
*/
foreach ( array( 'license-header', 'filedesc', 'filestatus',
'filesource' ) as $msgName ) {
- if ( in_array( $msgName,
(array)$wgForceUIMsgAsContentMsg ) ) {
+ if ( in_array( $msgName, $this->getConfig()->get(
'ForceUIMsgAsContentMsg' ) ) ) {
$msg[$msgName] = "{{int:$msgName}}";
} else {
$msg[$msgName] = wfMessage( $msgName
)->inContentLanguage()->text();
}
}
- if ( $wgUseCopyrightUpload ) {
+ if ( $this->getConfig()->get( 'UseCopyrightUpload' ) ) {
$licensetxt = '';
if ( $license != '' ) {
$licensetxt = '== ' . $msg['license-header'] .
" ==\n" . '{{' . $license . '}}' . "\n";
--
To view, visit https://gerrit.wikimedia.org/r/182136
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie17f7264096cd5fd4a45aafa0469a4a33709860b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: McIntireEvan <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits