r66989 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66988‎ | r66989 | r66990 >
Date:04:52, 28 May 2010
Author:tstarling
Status:deferred
Tags:
Comment:
MFT r66944: fixed non-JS uploads, were totally broken due to the lack of a default destination filename.
Modified paths:
  • /branches/REL1_16/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_16/phase3/includes/specials (modified) (history)
  • /branches/REL1_16/phase3/includes/specials/SpecialUpload.php (modified) (history)
  • /branches/REL1_16/phase3/includes/upload (modified) (history)
  • /branches/REL1_16/phase3/includes/upload/UploadFromFile.php (modified) (history)

Diff [purge]

Index: branches/REL1_16/phase3/includes/upload/UploadFromFile.php
@@ -13,7 +13,7 @@
1414 function initializeFromRequest( &$request ) {
1515 $desiredDestName = $request->getText( 'wpDestFile' );
1616 if( !$desiredDestName )
17 - $desiredDestName = $request->getText( 'wpUploadFile' );
 17+ $desiredDestName = $request->getFileName( 'wpUploadFile' );
1818 return $this->initializePathInfo(
1919 $desiredDestName,
2020 $request->getFileTempName( 'wpUploadFile' ),
Property changes on: branches/REL1_16/phase3/includes/upload
___________________________________________________________________
Name: svn:mergeinfo
2121 + /branches/REL1_15/phase3/includes/upload:51646
/branches/sqlite/includes/upload:58211-58321
/branches/wmf-deployment/includes/upload:53381
/trunk/phase3/includes/upload:63549,63764,63897-63901,64876,64881,64948,66944
Index: branches/REL1_16/phase3/includes/specials/SpecialUpload.php
@@ -69,8 +69,8 @@
7070
7171 // Guess the desired name from the filename if not provided
7272 $this->mDesiredDestName = $request->getText( 'wpDestFile' );
73 - if( !$this->mDesiredDestName )
74 - $this->mDesiredDestName = $request->getText( 'wpUploadFile' );
 73+ if( !$this->mDesiredDestName && $request->getFileName( 'wpUploadFile' ) !== null )
 74+ $this->mDesiredDestName = $request->getFileName( 'wpUploadFile' );
7575 $this->mComment = $request->getText( 'wpUploadDescription' );
7676 $this->mLicense = $request->getText( 'wpLicense' );
7777
@@ -221,6 +221,7 @@
222222
223223 'texttop' => $this->uploadFormTextTop,
224224 'textaftersummary' => $this->uploadFormTextAfterSummary,
 225+ 'destfile' => $this->mDesiredDestName,
225226 ) );
226227 $form->setTitle( $this->getTitle() );
227228
@@ -691,7 +692,8 @@
692693 protected $mSessionKey;
693694 protected $mHideIgnoreWarning;
694695 protected $mDestWarningAck;
695 -
 696+ protected $mDestFile;
 697+
696698 protected $mTextTop;
697699 protected $mTextAfterSummary;
698700
@@ -709,6 +711,7 @@
710712
711713 $this->mTextTop = $options['texttop'];
712714 $this->mTextAfterSummary = $options['textaftersummary'];
 715+ $this->mDestFile = isset( $options['destfile'] ) ? $options['destfile'] : '';
713716
714717 $sourceDescriptor = $this->getSourceSection();
715718 $descriptor = $sourceDescriptor
@@ -870,6 +873,9 @@
871874 'id' => 'wpDestFile',
872875 'label-message' => 'destfilename',
873876 'size' => 60,
 877+ 'default' => $this->mDestFile,
 878+ # FIXME: hack to work around poor handling of the 'default' option in HTMLForm
 879+ 'nodata' => strval( $this->mDestFile ) !== '',
874880 ),
875881 'UploadDescription' => array(
876882 'type' => 'textarea',
Property changes on: branches/REL1_16/phase3/includes/specials
___________________________________________________________________
Name: svn:mergeinfo
877883 - /branches/REL1_15/phase3/includes/specials:51646
/branches/sqlite/includes/specials:58211-58321
/branches/wmf-deployment/includes/specials:53381,56967
/trunk/phase3/includes/specials:63045,63047,63490,63549,63764,63897-63901,64180,64837,64846,64860,64862,64881,64948,64957,65025,65029
878884 + /branches/REL1_15/phase3/includes/specials:51646
/branches/sqlite/includes/specials:58211-58321
/branches/wmf-deployment/includes/specials:53381,56967
/trunk/phase3/includes/specials:63045,63047,63490,63549,63764,63897-63901,64180,64837,64846,64860,64862,64881,64948,64957,65025,65029,66944
Index: branches/REL1_16/phase3/RELEASE-NOTES
@@ -69,6 +69,9 @@
7070 * Fixed regression in unwatch links sent out in notification emails. When the
7171 mailing job was deferred via the job queue, the title was incorrect.
7272 * (bug 23534) Fixed SQL query error in API list=allusers.
 73+* Fixed a bug in uploads for non-JavaScript clients. An empty string was used
 74+ as the default destination filename, instead of the source filename as
 75+ expected.
7376
7477 === Changes since 1.16 beta 1 ===
7578

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r66944Fixed severe breakage of non-JS upload, presumably introduced in the 1.16 upl...tstarling07:30, 27 May 2010

Status & tagging log