(bug 11023) Don't register Special:Upload as a special page when uploads are disabled
authorRob Church <robchurch@users.mediawiki.org>
Wed, 22 Aug 2007 13:22:23 +0000 (13:22 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Wed, 22 Aug 2007 13:22:23 +0000 (13:22 +0000)
RELEASE-NOTES
includes/SpecialPage.php

index 619c4ef..31b92ac 100644 (file)
@@ -185,6 +185,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 9002) Provide a "view/restore deleted edits" link on Special:Upload
   when a destination filename is provided that corresponds with previous
   deleted files
+* (bug 11023) Don't register Special:Upload as a special page when uploads are
+  disabled
 
 == Bugfixes since 1.10 ==
 
index 89fd15b..1e83260 100644 (file)
@@ -84,7 +84,6 @@ class SpecialPage
                'Watchlist'                 => array( 'SpecialPage', 'Watchlist' ),
 
                'Recentchanges'             => array( 'IncludableSpecialPage', 'Recentchanges' ),
-               'Upload'                    => array( 'SpecialPage', 'Upload' ),
                'Imagelist'                 => array( 'SpecialPage', 'Imagelist' ),
                'Newimages'                 => array( 'IncludableSpecialPage', 'Newimages' ),
                'Listusers'                 => array( 'SpecialPage', 'Listusers' ),
@@ -160,7 +159,7 @@ class SpecialPage
         */
        static function initList() {
                global $wgSpecialPages;
-               global $wgDisableCounters, $wgDisableInternalSearch, $wgEmailAuthentication;
+               global $wgDisableCounters, $wgDisableInternalSearch, $wgEmailAuthentication, $wgEnableUploads;
 
                if ( self::$mListInitialised ) {
                        return;
@@ -182,6 +181,10 @@ class SpecialPage
                        self::$mList['Confirmemail'] = 'EmailConfirmation';
                }
 
+               if( $wgEnableUploads ) {
+                       self::$mList['Upload'] = array( 'SpecialPage', 'Upload' );
+               }
+
                # Add extension special pages
                self::$mList = array_merge( self::$mList, $wgSpecialPages );