BUG Attempt to access File::$allowed_extensions when uploading invalid file

Use Config to retrieve the variable instead of trying to access it
directly, and failing.