mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge pull request #2044 from prototech/ticket/12212
[ticket/12212] Encode the attachment file name before presenting to user.
This commit is contained in:
commit
2ffca79c0e
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue