chg: reverted to more strict file name pattern
This commit is contained in:
parent
f64a1fa25d
commit
11639f9319
2 changed files with 3 additions and 6 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue