From 68c64f4c251694fc7da4fcc6357997b22bf6a223 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 15 Jul 2009 09:39:38 +0000 Subject: [PATCH] * remove wfSpecialUpload() since UploadForm now extends SpecialPage * fix E_STRICT declaration of UploadForm::execute() should be compatible with SpecialPage::execute() --- includes/SpecialPage.php | 2 +- includes/specials/SpecialUpload.php | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index defb2ebe52..ed26b8b1c9 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -141,7 +141,7 @@ class SpecialPage { 'Filepath' => array( 'SpecialPage', 'Filepath' ), 'MIMEsearch' => array( 'SpecialPage', 'MIMEsearch' ), 'FileDuplicateSearch' => array( 'SpecialPage', 'FileDuplicateSearch' ), - 'Upload' => array( 'SpecialPage', 'Upload' ), + 'Upload' => 'UploadForm', # Wiki data and tools 'Statistics' => 'SpecialStatistics', diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 87c1096a8e..8e789eaf24 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -4,16 +4,6 @@ * @ingroup SpecialPage */ - -/** - * Entry point - */ -function wfSpecialUpload() { - global $wgRequest; - $form = new UploadForm( $wgRequest ); - $form->execute(); -} - /** * implements Special:Upload * @ingroup SpecialPage @@ -41,8 +31,18 @@ class UploadForm extends SpecialPage { * Get data POSTed through the form and assign them to the object * @param $request Data posted. */ - function __construct( &$request ) { - global $wgUser; + function __construct( $request = null ) { + global $wgUser, $wgRequest; + + parent::__construct( 'Upload' ); + + $this->setHeaders(); + $this->outputHeader(); + + if ( is_null( $request ) ) { + $request = $wgRequest; + } + // Guess the desired name from the filename if not provided $this->mDesiredDestName = $request->getText( 'wpDestFile' ); if( !$this->mDesiredDestName ) @@ -85,7 +85,7 @@ class UploadForm extends SpecialPage { * Start doing stuff * @access public */ - function execute() { + function execute( $par ) { global $wgUser, $wgOut; # Check uploading enabled if( !UploadBase::isEnabled() ) { -- 2.20.1