r76487 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76486‎ | r76487 | r76488 >
Date:01:24, 11 November 2010
Author:ashley
Status:deferred
Tags:
Comment:
MultiUpload: fix special page registration; Special:MultipleUpload as well as Special:SpecialPages were both returning "Fatal error: Call to undefined method SpecialUpload::SpecialPage() in extensions\MultiUpload\MultiUpload.body.php on line 29". also suppressed some notices about undefined indexes
Modified paths:
  • /trunk/extensions/MultiUpload/MultiUpload.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MultiUpload/MultiUpload.body.php
@@ -26,7 +26,7 @@
2727 public function __construct( $request = null ) {
2828 global $wgRequest;
2929
30 - parent::SpecialPage( 'MultipleUpload', 'upload' );
 30+ SpecialPage::__construct( 'MultipleUpload', 'upload' );
3131
3232 $this->loadRequest( is_null( $request ) ? $wgRequest : $request );
3333 $this->mUploadHasBeenShown = false;
@@ -45,7 +45,9 @@
4646 global $wgUser, $wgMaxUploadFiles;
4747
4848 // let's make the parent happy
 49+ wfSuppressWarnings();
4950 $_FILES['wpUploadFile'] = $_FILES['wpUploadFile0'];
 51+ wfRestoreWarnings();
5052 // Guess the desired name from the filename if not provided
5153 $this->mDesiredDestNames = array();
5254 $this->mUploads = array();
@@ -77,10 +79,14 @@
7880 if( !$this->mDesiredDestNames[$i] && $request->getFileName( 'wpUploadFile' . $i ) !== null ) {
7981 $this->mDesiredDestNames[$i] = $request->getFileName( 'wpUploadFile' . $i );
8082 }
 83+ wfSuppressWarnings();
8184 $request->setVal( 'wpUploadFile', $_FILES['wpUploadFile' . $i] );
 85+ wfRestoreWarnings();
8286 $request->setVal( 'wpDestFile', $request->getVal( 'wpDestFile' . $i ) );
8387 move_uploaded_file( 'wpUploadFile' . $i, 'wpUploadFile' );
 88+ wfSuppressWarnings();
8489 $_FILES['wpUploadFile'] = $_FILES['wpUploadFile' . $i];
 90+ wfRestoreWarnings();
8591 $up = UploadBase::createFromRequest( $request );
8692 $this->mUploads[$i] = $up;
8793 }

Status & tagging log