Page MenuHomePhabricator

UploadWizard doesn't provide any details for 'verification-error' ("This file might be corrupt, or have the wrong extension")
Closed, DuplicatePublic

Description

UploadWizard doesn't provide any details for 'verification-error' ("This file might be corrupt, or have the wrong extension"). This is a problem, since sometimes the file is not obviously corrupted and displays just fine in various applications, but MediaWiki rejects it. This also occurs for uploads blocked by AbuseFilter (T132866), but I think that is separate, as for AF we'd ideally just use a different error altogether.

Example:

(reported at https://commons.wikimedia.org/w/index.php?title=Commons:Upload_help&oldid=195480550#Upload_difficulties.2C_sourced_from_Wikimedia_Commons).

API response for it:

{
  "error": {
    "code": "verification-error",
    "info": "This file did not pass file verification: This SVG file contains an illegal namespace \"&ns_sfw;\".",
    "details": [
      "uploadscriptednamespace",
      "&ns_sfw;"
    ],
    "*": "See http://localhost:3080/w/api.php for API usage"
  }
}