aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarak <[email protected]>2017-02-09 18:26:49 -0500
committerGitHub <[email protected]>2017-02-09 18:26:49 -0500
commit2919b07973d5ff1bda890f38efe0644333bd1bad (patch)
treecc1d497e829e68f47fc4e73644922fab5f92ebd4 /lib
parent89df29c092a3d3581b76c8fa26101172271d1dc4 (diff)
parent4bffe048c114b4e11f527f05ddbbd7bbee294210 (diff)
downloadfaker-2919b07973d5ff1bda890f38efe0644333bd1bad.tar.xz
faker-2919b07973d5ff1bda890f38efe0644333bd1bad.zip
[api] [fix] Don't allow `/` in file names or paths
Don't allow path seperators in generated filenames
Diffstat (limited to 'lib')
-rw-r--r--lib/system.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/system.js b/lib/system.js
index 60a55246..9ef713c8 100644
--- a/lib/system.js
+++ b/lib/system.js
@@ -19,6 +19,7 @@ function System (faker) {
str = str.replace(/\,/g, '_');
str = str.replace(/\-/g, '_');
str = str.replace(/\\/g, '_');
+ str = str.replace(/\//g, '_');
str = str.toLowerCase();
return str;
};
@@ -36,6 +37,7 @@ function System (faker) {
str = str.replace(/\,/g, '_');
str = str.replace(/\-/g, '_');
str = str.replace(/\\/g, '_');
+ str = str.replace(/\//g, '_');
str = str.toLowerCase();
return str;
};
@@ -155,4 +157,4 @@ function System (faker) {
}
-module['exports'] = System; \ No newline at end of file
+module['exports'] = System;