Skip to content

Commit

Permalink
Revert "Don't allow : in file names. (rollup#3972)"
Browse files Browse the repository at this point in the history
This reverts commit 85304f2.
  • Loading branch information
guybedford committed Apr 20, 2021
1 parent a4a3b8a commit 14c76de
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 39 deletions.
7 changes: 1 addition & 6 deletions src/utils/sanitizeFileName.ts
@@ -1,8 +1,3 @@
export function sanitizeFileName(name: string): string {
const match = /^[a-z]:/i.exec(name);
const driveLetter = match ? match[0] : "";

// A `:` is only allowed as part of a windows drive letter (ex: C:\foo)
// Otherwise, avoid them because they can refer to NTFS alternate data streams.
return driveLetter + name.substr(driveLetter.length).replace(/[\0?*:]/g, '_');
return name.replace(/[\0?*]/g, '_');
}
2 changes: 1 addition & 1 deletion test/chunking-form/samples/sanitize-chunk-names/_config.js
Expand Up @@ -5,7 +5,7 @@ module.exports = {
plugins: [
{
options(options) {
options.input = ['\0virtual:entry-1', '\0virtual:entry-2'];
options.input = ['\0virtual-entry-1', '\0virtual-entry-2'];
return options;
},
resolveId(id) {
Expand Down
@@ -0,0 +1,7 @@
define(function () { 'use strict';

var _virtualEntry1 = "\u0000virtual-entry-1";

return _virtualEntry1;

});
@@ -0,0 +1,7 @@
define(function () { 'use strict';

var _virtualEntry2 = "\u0000virtual-entry-2";

return _virtualEntry2;

});

This file was deleted.

This file was deleted.

@@ -0,0 +1,5 @@
'use strict';

var _virtualEntry1 = "\u0000virtual-entry-1";

module.exports = _virtualEntry1;
@@ -0,0 +1,5 @@
'use strict';

var _virtualEntry2 = "\u0000virtual-entry-2";

module.exports = _virtualEntry2;

This file was deleted.

This file was deleted.

@@ -0,0 +1,3 @@
var _virtualEntry1 = "\u0000virtual-entry-1";

export default _virtualEntry1;
@@ -0,0 +1,3 @@
var _virtualEntry2 = "\u0000virtual-entry-2";

export default _virtualEntry2;

This file was deleted.

This file was deleted.

Expand Up @@ -3,7 +3,7 @@ System.register([], function (exports) {
return {
execute: function () {

var _virtual_entry1 = exports('default', "\u0000virtual:entry-1");
var _virtualEntry1 = exports('default', "\u0000virtual-entry-1");

}
};
Expand Down
Expand Up @@ -3,7 +3,7 @@ System.register([], function (exports) {
return {
execute: function () {

var _virtual_entry2 = exports('default', "\u0000virtual:entry-2");
var _virtualEntry2 = exports('default', "\u0000virtual-entry-2");

}
};
Expand Down

0 comments on commit 14c76de

Please sign in to comment.