Last modified: 2014-05-12 19:37:10 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 T32095, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30095 - UploadWizard should have more specific error message for files that contain HTML in the EXIF data
UploadWizard should have more specific error message for files that contain H...
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
UploadWizard (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-28 01:52 UTC by Ryan Kaldari
Modified: 2014-05-12 19:37 UTC (History)
5 users (show)

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


Attachments

Description Ryan Kaldari 2011-07-28 01:52:37 UTC
If you try to upload a file that contains HTML in the EXIF data using Special:Upload it gives you the following error:
"This file contains HTML or script code that may be erroneously interpreted by a web browser."

If you try to upload the same file using UploadWizard, it gives you the following error:
"This file might be corrupt, or have the wrong extension."

It would be nice if the UploadWizard error were more specific.
Comment 1 Mark Holmquist 2012-06-05 19:12:08 UTC
Hi, Ryan, two questions:

1. That message, I think, doesn't always show up where it used to. Could you confirm that this still happens?

2. Could you attach a file with HTML in the EXIF data for testing purposes?

If you just fulfill number 2, I can test number 1.

Thanks!
Comment 2 Mark Holmquist 2012-08-16 16:26:15 UTC
Recently, a patch to MediaWiki core [0] changed the behavior of API warnings. We now get those at the first step, even if we don't handle them necessarily.

Could you try to reproduce this bug, and let us know if it still occurs? If so, the solution would likely be very different from before this patch.

[0] https://gerrit.wikimedia.org/r/#/c/9261/

Thanks!
Comment 3 Derk-Jan Hartman 2012-08-26 01:40:13 UTC
This is not yet fixed.

This is a bug in the errors handlers. An API error is a code, an info and an optional 'details' array of message keys.

We use the code to get a UW specific error description. Normally this description is in 'info', but we don't seem to use that one. The details are not passed at all.


In this specific case we have:

code: 'verification-error',
info: "This file did not pass file verification",
details: [ "uploadscripted"]

The info corresponds to the msg of 'verification-error'
The uploadscripted corresponds to a msg key for ""This file contains HTML or script code that may be erroneously interpreted by a web browser."

Instead we display api-error-verification-error. Interesting observation, these api-error-* messages seem to be solely for UW, but are in the mediawiki-core translations.
Comment 4 Derk-Jan Hartman 2012-08-29 22:18:42 UTC
For the entire error handler, we ought to implement something the likes of

processVerificationError() of SpecialUpload.php

we should expand showError() to showError(code, info, details) and pass details if the api error result has them. We can then also move the filetype-banned-type handling into showError.
Comment 5 Jarek Tuszynski 2014-05-12 19:37:10 UTC
Here is an example of a flickr file with some html in EXIF.  

Uploading https://www.flickr.com/photos/arthurhsu/8004910780/in/set-72157631578196004/ file using flickr  version of UploadWizard results in "This file might be corrupt, or have the wrong extension." error.

Upload of the same file manually (via local download) through UploadWizard gives "Internal error: Server failed to store temporary file." error. 

The old fashion Special:Upload gives the most clear "This file contains HTML or script code that may be erroneously interpreted by a web browser." error. Now I was able to figure out what is the issue, stripped all EXIF from the file and reuploded as https://commons.wikimedia.org/wiki/File:Coopers_Rock,_WV_-_Tomb_Raider_Roof_-_2.jpg

UploadWizard should be able to strip HTML from the EXIF data, but if not than at least give more meaningful error message.

Another example: https://www.flickr.com/photos/arthurhsu/8004906216/in/set-72157631578196004/

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


Navigation
Links