From ea8f91a6ebf24345f063362478c739001876f85b Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 12 Jan 2009 14:28:46 +0000 Subject: [PATCH] (bug 16968) Don't throw useless warnings on Special:Upload. We don't warn the user about spaces/underscores anywhere else, why bother with it here? And if $wgCapitalLinks is enabled, we should silently deal with it, rather than make the user think they've done something wrong. --- RELEASE-NOTES | 1 + includes/specials/SpecialUpload.php | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8258d34d70..d744a0cd78 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -38,6 +38,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN === Bug fixes in 1.15 === * Fixing the caching issue by using -{T|xxx}- syntax (only applies on wiki with LanguageConverter class) * Improving the efficiency by using -{A|xxx}- syntax (only applies on wiki with LanguageConverter class) +* (bug 16968) Special:Upload no longer throws useless warnings. == API changes in 1.15 == * (bug 16798) JSON encoding errors for some characters outside the BMP diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 971de04078..3e2c02ad62 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -504,13 +504,14 @@ class UploadForm { if ( ! $this->mIgnoreWarning ) { $warning = ''; + if( str_replace( ' ', '_', $basename ) != $filtered ) { + $warning .= '
  • '.wfMsgHtml( 'badfilename', htmlspecialchars( $this->mDestName ) ).'
  • '; + } + global $wgCapitalLinks; if( $wgCapitalLinks ) { $filtered = ucfirst( $filtered ); } - if( $basename != $filtered ) { - $warning .= '
  • '.wfMsgHtml( 'badfilename', htmlspecialchars( $this->mDestName ) ).'
  • '; - } global $wgCheckFileExtensions; if ( $wgCheckFileExtensions ) { -- 2.20.1