Last modified: 2009-01-20 23:03:19 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. :)
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?
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.
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.
Reopening, dunno how I marked this as fixed....
A clear error message is appropriate here so the admin will have a clue where to look.
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.
Done in r45812
Ahh, that's so much better than just mysteriously failing. :D Thanks!