Skip to content

Commit

Permalink
[WIP] Fixing issue 13099
Browse files Browse the repository at this point in the history
  • Loading branch information
sdalmeida committed Apr 2, 2017
1 parent fba7428 commit 0a08247
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/project/ProjectModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ define(function (require, exports, module) {
* also used to substitute the place holder of the error message.
*/
var _invalidChars;

var _pattern = /([?\*\|\:\<\>\\]+|\/{2,}|\.{2,}|\.$)/i // TODO: This will replace _invalidChars

/**
* @private
* RegEx to validate if a filename is not allowed even if the system allows it.
Expand All @@ -99,8 +100,7 @@ define(function (require, exports, module) {
// Checks for valid Windows filenames:
// See http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
return !(
new RegExp("[" + invalidChars + "]+").test(filename) ||
_illegalFilenamesRegEx.test(filename)
filename.match(_pattern) || filename.match(_illegalFilenamesRegEx)
);
}

Expand Down Expand Up @@ -182,8 +182,8 @@ define(function (require, exports, module) {
function doCreate(path, isFolder) {
var d = new $.Deferred();

var name = FileUtils.getBaseName(path);
if (!isValidFilename(name, _invalidChars)) {
// Check if full path is valid
if (!isValidFilename(path, _invalidChars)) {
return d.reject(ERROR_INVALID_FILENAME).promise();
}

Expand Down

0 comments on commit 0a08247

Please sign in to comment.