diff options
author | kondou <kondou@ts.unde.re> | 2014-03-12 15:29:26 +0100 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2014-03-12 15:29:26 +0100 |
commit | 1c82b4751ecb69ed1f0973b3cde0a255daaf9747 (patch) | |
tree | cc119884b60578201989135dede0fb73622f07bd /apps/files/js/files.js | |
parent | 3c11dc0006d5a3722b37bed274d8d19be219b6b2 (diff) | |
parent | ce790119aea4a1cec2e8d8e8b493fec00b87693f (diff) | |
download | nextcloud-server-1c82b4751ecb69ed1f0973b3cde0a255daaf9747.tar.gz nextcloud-server-1c82b4751ecb69ed1f0973b3cde0a255daaf9747.zip |
Merge branch 'master' into hide_remove_image_avatar
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r-- | apps/files/js/files.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index f4546120702..1186a72a44f 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -87,9 +87,12 @@ var Files = { * Throws a string exception with an error message if * the file name is not valid */ - isFileNameValid: function (name) { + isFileNameValid: function (name, root) { var trimmedName = name.trim(); - if (trimmedName === '.' || trimmedName === '..') { + if (trimmedName === '.' + || trimmedName === '..' + || (root === '/' && trimmedName.toLowerCase() === 'shared')) + { throw t('files', '"{name}" is an invalid file name.', {name: name}); } else if (trimmedName.length === 0) { throw t('files', 'File name cannot be empty.'); @@ -780,9 +783,9 @@ Files.lazyLoadPreview = function(path, mime, ready, width, height, etag) { if ( $('#isPublic').length ) { urlSpec.t = $('#dirToken').val(); - previewURL = OC.Router.generate('core_ajax_public_preview', urlSpec); + previewURL = OC.generateUrl('/publicpreview.png?') + $.param(urlSpec); } else { - previewURL = OC.Router.generate('core_ajax_preview', urlSpec); + previewURL = OC.generateUrl('/core/preview.png?') + $.param(urlSpec); } previewURL = previewURL.replace('(', '%28'); previewURL = previewURL.replace(')', '%29'); |