diff --git a/code/File/File.js b/code/File/File.js index 4753f877..9b20a27d 100644 --- a/code/File/File.js +++ b/code/File/File.js @@ -65,11 +65,8 @@ File.remove = function() { * @param {String} name */ File.getName = function(name) { - if (name) { - //return name.replace(/[^\w\d\s._-]/g, String.EMPTY); - return String(name).trim().replace(/[\/\\:;?+\[\]{}|#"`<>^]/g, String.EMPTY); - } - return null; + // TODO: Maybe return a hash if name is undefined? + return name ? String(name).replace(/[^\w\d\s,._-]/g, String.EMPTY) : null; } File.getGenericType = function (contentType) { diff --git a/code/Image/Image.js b/code/Image/Image.js index ba0ec1f0..800c9f60 100644 --- a/code/Image/Image.js +++ b/code/Image/Image.js @@ -302,7 +302,7 @@ Image.prototype.update = function(data) { File.prototype.setOrigin.call(this, origin); if (!this.name) { - var name = File.getName(data.name) || mimeName.split('.')[0]; + var name = File.getName(data.name || mimeName.split('.')[0]); this.name = this.parent.images.getAccessName(name); }