From: Rotem Liss Date: Fri, 29 Aug 2008 10:25:24 +0000 (+0000) Subject: Fixing a fatal error on upload page: X-Git-Tag: 1.31.0-rc.0~45570 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=01aadc64cbf42a05dce7ee23412b43d5b7fa4dcb;p=lhc%2Fweb%2Fwiklou.git Fixing a fatal error on upload page: Fatal error: Call to a member function isAllowed() on a non-object in /home/rotemliss/Server/wiki/source/trunk/phase3/includes/specials/SpecialUpload.php on line 125 The old code (introduced in r40190) used a $this->mUpload object, which does not exist on GET requests to Special:Upload. The new code uses direct User::isAllowed check in such cases. --- diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 35a9208b66..d2a55f0333 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -122,7 +122,11 @@ class UploadForm { } # Check permissions - $permission = $this->mUpload->isAllowed( $wgUser ); + if( $this->mUpload ) { + $permission = $this->mUpload->isAllowed( $wgUser ); + } else { + $permission = $wgUser->isAllowed( 'upload' ) ? true : 'upload'; + } if( $permission !== true ) { if( !$wgUser->isLoggedIn() ) { $wgOut->showErrorPage( 'uploadnologin', 'uploadnologintext' );