r68848 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68847‎ | r68848 | r68849 >
Date:19:55, 1 July 2010
Author:hartman
Status:resolved
Tags:
Comment:
(bug 24022) Don't check extensions of files in uploadpage script when $wgStrictFileExtensions == false
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)
  • /trunk/phase3/skins/common/upload.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/upload.js
@@ -242,7 +242,7 @@
243243 // Clear the filename if it does not have a valid extension.
244244 // URLs are less likely to have a useful extension, so don't include them in the
245245 // extension check.
246 - if( wgFileExtensions && id != 'wpUploadFileURL' ) {
 246+ if( $wgStrictFileExtensions && wgFileExtensions && id != 'wpUploadFileURL' ) {
247247 var found = false;
248248 if( fname.lastIndexOf( '.' ) != -1 ) {
249249 var ext = fname.substr( fname.lastIndexOf( '.' ) + 1 );
Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -1044,7 +1044,7 @@
10451045 * Add upload JS to $wgOut
10461046 */
10471047 protected function addUploadJS() {
1048 - global $wgUseAjax, $wgAjaxUploadDestCheck, $wgAjaxLicensePreview, $wgEnableAPI;
 1048+ global $wgUseAjax, $wgAjaxUploadDestCheck, $wgAjaxLicensePreview, $wgEnableAPI, $wgStrictFileExtensions;
10491049 global $wgOut;
10501050
10511051 $useAjaxDestCheck = $wgUseAjax && $wgAjaxUploadDestCheck;
@@ -1058,6 +1058,7 @@
10591059 // the wpDestFile textbox
10601060 $this->mDestFile === '',
10611061 'wgUploadSourceIds' => $this->mSourceIds,
 1062+ 'wgStrictFileExtensions' => $wgStrictFileExtensions,
10621063 );
10631064
10641065 $wgOut->addScript( Skin::makeVariablesScript( $scriptVars ) );
Index: trunk/phase3/RELEASE-NOTES
@@ -221,6 +221,7 @@
222222 * (bug 23642) Recognize mime types of MS OpenXML documents.
223223 * (bug 22784) Normalise underscores and spaces in autocomments.
224224 * (bug 19910) Headings of the form ===+\s+ are now displayed as valid headings
 225+* (bug 24022) Only check file extensions on the uploadpage when needed.
225226
226227 === API changes in 1.17 ===
227228 * (bug 22738) Allow filtering by action type on query=logevent.

Follow-up revisions

RevisionCommit summaryAuthorDate
r68849Make sure we use the right variable. Follow up r68848.hartman19:57, 1 July 2010

Status & tagging log