Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/292789
Change subject: mw.FirefoggHandler: Bail on non-ASCII filenames ...................................................................... mw.FirefoggHandler: Bail on non-ASCII filenames Unfortunately, Firefogg does not correctly handle filenames with non-ASCII characters in them. There doesn't seem to be a way to work around this, so don't let it touch them, and display a message saying it's not our fault and explaining how to work around the issue. Bug: T136879 Change-Id: I28cc9617423145495aeebdb92a4637f418c1c042 --- M UploadWizard.php M i18n/en.json M i18n/qqq.json M resources/handlers/mw.FirefoggHandler.js 4 files changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/89/292789/1 diff --git a/UploadWizard.php b/UploadWizard.php index a5bca53..de3b54e 100644 --- a/UploadWizard.php +++ b/UploadWizard.php @@ -328,6 +328,7 @@ 'mwe-upwiz-select-flickr', 'mwe-upwiz-flickr-disclaimer1', 'mwe-upwiz-flickr-disclaimer2', + 'mwe-upwiz-firefogg-nonascii', 'mwe-upwiz-encoding', 'mwe-upwiz-uploading', 'mwe-upwiz-queued', diff --git a/i18n/en.json b/i18n/en.json index 31da3c1..685c3ed 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -45,6 +45,7 @@ "mwe-upwiz-flickr-disclaimer2": "Please note that by using this tool, your IP address and request details will be available to Flickr.", "mwe-upwiz-error-no-image-retrieved": "We could not retrieve the file from $1.", "mwe-upwiz-multi-file-select": "Draw a box with your cursor over the files you would like to upload. Hold down the $2 key to make multiple non-adjacent selections. You can select up to $1 {{PLURAL:$1|file|files}} to upload.", + "mwe-upwiz-firefogg-nonascii": "Firefogg does not support filenames that contain accented characters, such as 'é' or 'ä'. Please rename the file to remove them all and try again. You will be able to correct the filename later.", "mwe-upwiz-transport-started": "Starting...", "mwe-upwiz-encoding": "Encoding...", "mwe-upwiz-uploading": "Uploading...", diff --git a/i18n/qqq.json b/i18n/qqq.json index a0c09b3..ae9c9d6 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -69,6 +69,7 @@ "mwe-upwiz-flickr-disclaimer2": "This is a legal disclaimer to let the user know that their IP address will be sent to Flickr when they submit the form. Please try to keep the wording similar to the approved version in English.", "mwe-upwiz-error-no-image-retrieved": "Error message shown when UploadWizard is not able to retrieve an image from a remote source. $1 is the name of the remote source, for example, Flickr.", "mwe-upwiz-multi-file-select": "Instructions that appear when the user can select multiple files to upload. See http://jqueryui.com/demos/selectable/#display-grid for how this works.\n* $1 - the maximum number of files that can be selected\n* $2 - either Command or Ctrl, depending on the user's detected operating system", + "mwe-upwiz-firefogg-nonascii": "Error message shown when the user chooses a video file that Firefogg can't handle.\n\nFeel free to replace 'é' and 'ä' with characters specific to your language, if any.", "mwe-upwiz-transport-started": "Status message when upload starts", "mwe-upwiz-encoding": "Status message while encoding with Firefogg", "mwe-upwiz-uploading": "Status message while upload is ongoing.\n{{Identical|Uploading}}", diff --git a/resources/handlers/mw.FirefoggHandler.js b/resources/handlers/mw.FirefoggHandler.js index f57c62f..9798452 100644 --- a/resources/handlers/mw.FirefoggHandler.js +++ b/resources/handlers/mw.FirefoggHandler.js @@ -60,6 +60,13 @@ handler = this, upload = this.upload; + // Bail on non-ASCII filenames + if ( !this.upload.title || !( /^[\x00-\x7F]*$/.test( this.upload.title.getMain() ) ) ) { + this.upload.setError( 'firefogg-nonascii', '' ); + this.upload.ui.setStatus( 'mwe-upwiz-firefogg-nonascii' ); + return $.Deferred().reject(); + } + mw.log( 'mw.FirefoggHandler::start> Upload start!' ); // pass file to Firefogg -- To view, visit https://gerrit.wikimedia.org/r/292789 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I28cc9617423145495aeebdb92a4637f418c1c042 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UploadWizard Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński <matma....@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits