Merge pull request #2044 from prototech/ticket/12212

[ticket/12212] Encode the attachment file name before presenting to user.
This commit is contained in:
Nathan Guse 2014-02-20 10:18:22 -06:00
commit 2ffca79c0e

View file

@ -162,7 +162,7 @@ phpbb.plupload.insertRow = function(file) {
var row = $(phpbb.plupload.rowTpl);
row.attr('id', file.id);
row.find('.file-name').html(file.name);
row.find('.file-name').html(plupload.xmlEncode(file.name));
row.find('.file-size').html(plupload.formatSize(file.size));
if (phpbb.plupload.order == 'desc') {
@ -499,6 +499,8 @@ $('#file-list').on('click', '.file-error', function(e) {
* Fires when an error occurs.
*/
uploader.bind('Error', function(up, error) {
error.file.name = plupload.xmlEncode(error.file.name);
// The error message that Plupload provides for these is vague, so we'll be more specific.
if (error.code === plupload.FILE_EXTENSION_ERROR) {
error.message = plupload.translate('Invalid file extension:') + ' ' + error.file.name;