Last modified: 2009-01-20 23:03:19 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T19035, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17035 - Check PHP file_uploads settings in Special:Upload
Check PHP file_uploads settings in Special:Upload
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
http://www.mediawiki.org/wiki/Manual:...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-15 18:07 UTC by Brion Vibber
Modified: 2009-01-20 23:03 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brion Vibber 2009-01-15 18:07:02 UTC
It seems we don't actually confirm that file uploads are enabled in PHP... It would be wise for us to check this and tell the poor user he has to fix it in a nice error message. :)
Comment 1 Chad H. 2009-01-15 20:43:02 UTC
Right now in execute(), we check if $wgEnableUploads is true, then we output the 'uploaddisabled' message if not:

if( !$wgEnableUploads ) {

To the end users, there's no difference in _why_ it is disabled, so I would think the generic disabled message could be used here. A simple change to:

if( !$wgEnableUploads || !wfIniGetBool( 'file_uploads' ) ) {

should do it?
Comment 2 Brion Vibber 2009-01-16 17:30:48 UTC
There's a big fat huge difference to the admin who's trying to figure out why uploads don't work even though he enabled them on the wiki.
Comment 3 Chad H. 2009-01-16 17:42:00 UTC
Right, but error messages aren't intended for the sysop, they're for the end users. What about throwing a wfDebug() call in there, saying "Uploads are disabled: Check that you've set $wgEnableUploads to true and that PHP's file_uploads is enabled" or some variant.
Comment 4 Chad H. 2009-01-16 17:42:26 UTC
Reopening, dunno how I marked this as fixed....
Comment 5 Brion Vibber 2009-01-16 17:43:45 UTC
A clear error message is appropriate here so the admin will have a clue where to look.
Comment 6 Chad H. 2009-01-16 17:46:27 UTC
You're the boss :) I'll whip up a patch later today and commit if no one beats me to it. Should be simple enough to do the check right before we've checked $wgEnableUploads then. No point in checking our setting if PHP doesn't allow it at all.
Comment 7 Chad H. 2009-01-16 21:19:39 UTC
Done in r45812
Comment 8 Brion Vibber 2009-01-20 23:03:19 UTC
Ahh, that's so much better than just mysteriously failing. :D Thanks!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links