diff mbox

utils: add additional characters to path sanitiser

Message ID 20170203041049.6790-1-andrew.donnellan@au1.ibm.com
State Accepted
Headers show

Commit Message

Andrew Donnellan Feb. 3, 2017, 4:10 a.m. UTC
From: Russell Currey <ruscur@russell.cc>

Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

---

Already committed, for information only

---
 src/utils.rs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/src/utils.rs b/src/utils.rs
index 0781447..aca373a 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -15,5 +15,8 @@ 
 
 pub fn sanitise_path(path: String) -> String {
     path.replace("/", "_").replace("\\", "_").replace(".", "_")
-        .replace("~", "_").replace(" ", "_")
+        .replace("~", "_").replace(" ", "_").replace(":", "")
+        .replace("[", "_").replace("]", "_").replace("'", "")
+        .replace("\"", "").replace("(", "_").replace(")", "_")
+        .replace("*", "_").replace("?", "_")
 }