aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/file-upload.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-01-10 15:02:26 +0100
committerVincent Petry <pvince81@owncloud.com>2014-01-10 15:02:26 +0100
commit1042733634622b234beb52e24505d56a9883b4eb (patch)
tree4300040f44d951823645d35d98e1b263de49fd07 /apps/files/js/file-upload.js
parentb24c21b00f0116e8749f37646cc25f798992bf05 (diff)
downloadnextcloud-server-1042733634622b234beb52e24505d56a9883b4eb.tar.gz
nextcloud-server-1042733634622b234beb52e24505d56a9883b4eb.zip
Fixed various file name escaping issues in core apps
- Refactored file tr lookup into FileList.findFileEl that uses filterAttr to avoid escaping issues in jQuery selectors - Fixed versions and sharing app to properly escape file names in attributes
Diffstat (limited to 'apps/files/js/file-upload.js')
-rw-r--r--apps/files/js/file-upload.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index 196817432d5..225c3319107 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -222,6 +222,14 @@ $(document).ready(function() {
//examine file
var file = data.files[0];
+ try {
+ // FIXME: not so elegant... need to refactor that method to return a value
+ Files.isFileNameValid(file.name);
+ }
+ catch (errorMessage) {
+ data.textStatus = 'invalidcharacters';
+ data.errorThrown = errorMessage;
+ }
if (file.type === '' && file.size === 4096) {
data.textStatus = 'dirorzero';
@@ -605,7 +613,7 @@ $(document).ready(function() {
if (result.status === 'success') {
var date=new Date();
FileList.addDir(name, 0, date, hidden);
- var tr=$('tr[data-file="'+name+'"]');
+ var tr = FileList.findFileEl(name);
tr.attr('data-id', result.data.id);
} else {
OC.dialogs.alert(result.data.message, t('core', 'Could not create folder'));
@@ -647,7 +655,7 @@ $(document).ready(function() {
$('#uploadprogressbar').fadeOut();
var date = new Date();
FileList.addFile(localName, size, date, false, hidden);
- var tr = $('tr[data-file="'+localName+'"]');
+ var tr = FileList.findFileEl(localName);
tr.data('mime', mime).data('id', id);
tr.attr('data-id', id);
var path = $('#dir').val()+'/'+localName;