r52761 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52760‎ | r52761 | r52762 >
Date:01:37, 4 July 2009
Author:demon
Status:ok
Tags:
Comment:
(bug 19509) can't upload to file called '0'. Patch by Lee Worden.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -405,7 +405,7 @@
406406 * filter out illegal characters, and try to make a legible name
407407 * out of it. We'll strip some silently that Title would die on.
408408 */
409 - if( $this->mDesiredDestName ) {
 409+ if( $this->mDesiredDestName != '' ) {
410410 $basename = $this->mDesiredDestName;
411411 } else {
412412 $basename = $this->mSrcName;
@@ -1000,7 +1000,7 @@
10011001 return false;
10021002 }
10031003
1004 - if( $this->mDesiredDestName ) {
 1004+ if( $this->mDesiredDestName != '' ) {
10051005 $title = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
10061006 // Show a subtitle link to deleted revisions (to sysops et al only)
10071007 if( $title instanceof Title && ( $count = $title->isDeleted() ) > 0 && $wgUser->isAllowed( 'deletedhistory' ) ) {
@@ -1136,7 +1136,7 @@
11371137 } else {
11381138 $filename_form =
11391139 "<input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' " .
1140 - ($this->mDesiredDestName?"":"onchange='fillDestFilename(\"wpUploadFile\")' ") .
 1140+ ($this->mDesiredDestName!=''?"":"onchange='fillDestFilename(\"wpUploadFile\")' ") .
11411141 "size='60' />" .
11421142 "<input type='hidden' name='wpSourceType' value='file' />" ;
11431143 }
Index: trunk/phase3/RELEASE-NOTES
@@ -224,6 +224,9 @@
225225 whether the engines are actually available
226226 * (bug 19390) Omit the "printable version" link on the printable version
227227 * (bug 18394) img_auth.php now respects userCan
 228+* (bug 19509) Uploading to a file named '0' previously treated it as null input
 229+ and attempted to upload with the source name. Now warns about not having an
 230+ extension (since 0.ext is perfectly valid)
228231
229232 == API changes in 1.16 ==
230233

Status & tagging log