r76096 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76095‎ | r76096 | r76097 >
Date:14:42, 5 November 2010
Author:catrope
Status:deferred
Tags:
Comment:
Merge UploadFromFile.php changes in r70037 and r70049, but without the max file size logic
Modified paths:
  • /branches/uploadwizard-deployment/includes/upload/UploadFromFile.php (modified) (history)

Diff [purge]

Index: branches/uploadwizard-deployment/includes/upload/UploadFromFile.php
@@ -8,23 +8,24 @@
99 * Implements regular file uploads
1010 */
1111 class UploadFromFile extends UploadBase {
 12+ protected $mUpload = null;
1213
13 -
1414 function initializeFromRequest( &$request ) {
 15+ $upload = $request->getUpload( 'wpUploadFile' );
1516 $desiredDestName = $request->getText( 'wpDestFile' );
1617 if( !$desiredDestName )
17 - $desiredDestName = $request->getText( 'wpUploadFile' );
18 - return $this->initializePathInfo(
19 - $desiredDestName,
20 - $request->getFileTempName( 'wpUploadFile' ),
21 - $request->getFileSize( 'wpUploadFile' )
22 - );
 18+ $desiredDestName = $upload->getName();
 19+
 20+ return $this->initialize( $desiredDestName, $upload );
2321 }
 22+
2423 /**
25 - * Entry point for upload from file.
 24+ * Initialize from a filename and a WebRequestUpload
2625 */
27 - function initialize( $name, $tempPath, $fileSize ) {
28 - return $this->initializePathInfo( $name, $tempPath, $fileSize );
 26+ function initialize( $name, $webRequestUpload ) {
 27+ $this->mUpload = $webRequestUpload;
 28+ return $this->initializePathInfo( $name,
 29+ $this->mUpload->getTempName(), $this->mUpload->getSize() );
2930 }
3031 static function isValidRequest( $request ) {
3132 return (bool)$request->getFileTempName( 'wpUploadFile' );
@@ -37,6 +38,4 @@
3839 public function getFileTempname() {
3940 return $this->mUpload->getTempname();
4041 }
41 -
42 -
4342 }
Property changes on: branches/uploadwizard-deployment/includes/upload/UploadFromFile.php
___________________________________________________________________
Modified: svn:mergeinfo
4443 Merged /trunk/phase3/includes/upload/UploadFromFile.php:r70037,70049

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70037(bug 23380) Uploaded files that are larger than allowed by PHP now show a use...btongminh20:38, 27 July 2010
r70049Follow-up r70037: Fix ApiUpload by passing a WebRequestUpload to the the init...btongminh21:53, 27 July 2010

Status & tagging log