aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/files.js
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-03-13 15:22:00 +0100
committerRobin Appelman <icewind@owncloud.com>2014-03-13 15:22:00 +0100
commiteabeedb306849e3ec8916de5791a3951074a199f (patch)
treed3008c69ec094a032728447d7999b217304e410b /apps/files/js/files.js
parent895fc0fa26ee5a1e9dbadb09736dbb56cad0c6e8 (diff)
parent3c03ff5bb554b0b738864f857d18e35762f13d18 (diff)
downloadnextcloud-server-eabeedb306849e3ec8916de5791a3951074a199f.tar.gz
nextcloud-server-eabeedb306849e3ec8916de5791a3951074a199f.zip
Merge branch 'master' into cachehooks-first
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r--apps/files/js/files.js11
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');