Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1143,6 +1143,7 @@ |
1144 | 1144 | 'overwroteimage', |
1145 | 1145 | 'uploaddisabled', |
1146 | 1146 | 'uploaddisabledtext', |
| 1147 | + 'php-uploaddisabledtext', |
1147 | 1148 | 'uploadscripted', |
1148 | 1149 | 'uploadcorrupt', |
1149 | 1150 | 'uploadvirus', |
Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -228,6 +228,12 @@ |
229 | 229 | global $wgUser, $wgOut; |
230 | 230 | global $wgEnableUploads; |
231 | 231 | |
| 232 | + # Check php's file_uploads setting |
| 233 | + if( !wfIniGetBool( 'file_uploads' ) ) { |
| 234 | + $wgOut->showErrorPage( 'uploaddisabled', 'php-uploaddisabledtext', array( $this->mDesiredDestName ) ); |
| 235 | + return; |
| 236 | + } |
| 237 | + |
232 | 238 | # Check uploading enabled |
233 | 239 | if( !$wgEnableUploads ) { |
234 | 240 | $wgOut->showErrorPage( 'uploaddisabled', 'uploaddisabledtext', array( $this->mDesiredDestName ) ); |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1834,6 +1834,7 @@ |
1835 | 1835 | 'uploadedimage' => 'uploaded "[[$1]]"', |
1836 | 1836 | 'overwroteimage' => 'uploaded a new version of "[[$1]]"', |
1837 | 1837 | 'uploaddisabled' => 'Uploads disabled', |
| 1838 | +'php-uploaddisabledtext' => 'PHP file uploads are disabled. Please check the file_uploads setting.', |
1838 | 1839 | 'uploaddisabledtext' => 'File uploads are disabled.', |
1839 | 1840 | 'uploadscripted' => 'This file contains HTML or script code that may be erroneously interpreted by a web browser.', |
1840 | 1841 | 'uploadcorrupt' => 'The file is corrupt or has an incorrect extension. |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -43,6 +43,8 @@ |
44 | 44 | * (bug 17010) maintenance/namespaceDupes.php now add the suffix recursively if |
45 | 45 | the destination page exists |
46 | 46 | * Page moves should not be minor edits |
| 47 | +* (bug 17035) Special:Upload now fails gracefully if PHP's file_uploads has been |
| 48 | + disabled |
47 | 49 | |
48 | 50 | == API changes in 1.15 == |
49 | 51 | * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions |