(bug 17035) Fail gracefully if php's file_uploads are disabled.
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 16 Jan 2009 21:19:12 +0000 (21:19 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 16 Jan 2009 21:19:12 +0000 (21:19 +0000)
RELEASE-NOTES
includes/specials/SpecialUpload.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index c2a79c5..3d4db25 100644 (file)
@@ -43,6 +43,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 17010) maintenance/namespaceDupes.php now add the suffix recursively if
   the destination page exists
 * Page moves should not be minor edits
+* (bug 17035) Special:Upload now fails gracefully if PHP's file_uploads has been
+  disabled
 
 == API changes in 1.15 ==
 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions
index adfea71..bfbc290 100644 (file)
@@ -228,6 +228,12 @@ class UploadForm {
                global $wgUser, $wgOut;
                global $wgEnableUploads;
 
+               # Check php's file_uploads setting
+               if( !wfIniGetBool( 'file_uploads' ) ) {
+                       $wgOut->showErrorPage( 'uploaddisabled', 'php-uploaddisabledtext', array( $this->mDesiredDestName ) );
+                       return;
+               }
+
                # Check uploading enabled
                if( !$wgEnableUploads ) {
                        $wgOut->showErrorPage( 'uploaddisabled', 'uploaddisabledtext', array( $this->mDesiredDestName ) );
index 66a26bc..9d0dd1d 100644 (file)
@@ -1834,6 +1834,7 @@ If you still want to upload your file, please go back and use a new name. [[File
 'uploadedimage'               => 'uploaded "[[$1]]"',
 'overwroteimage'              => 'uploaded a new version of "[[$1]]"',
 'uploaddisabled'              => 'Uploads disabled',
+'php-uploaddisabledtext'      => 'PHP file uploads are disabled. Please check the file_uploads setting.',
 'uploaddisabledtext'          => 'File uploads are disabled.',
 'uploadscripted'              => 'This file contains HTML or script code that may be erroneously interpreted by a web browser.',
 'uploadcorrupt'               => 'The file is corrupt or has an incorrect extension.
index 97cdf2d..a476c01 100644 (file)
@@ -1143,6 +1143,7 @@ $wgMessageStructure = array(
                'overwroteimage',
                'uploaddisabled',
                'uploaddisabledtext',
+               'php-uploaddisabledtext',
                'uploadscripted',
                'uploadcorrupt',
                'uploadvirus',