diff --git a/src/node/db/API.js b/src/node/db/API.js index 8317cb915..900ca8025 100644 --- a/src/node/db/API.js +++ b/src/node/db/API.js @@ -331,7 +331,7 @@ exports.createPad = function(padID, text, callback) callback(new customError("createPad can't create group pads","apierror")); return; } - padID = padID.replace(/[^a-z0-9_\-]/gi, '_'); + padID = padID.replace(/[;\/\?:@&=\+\$,{}\\\^\[\]\`\|]/gi, '_'); //create pad getPadSafe(padID, false, text, function(err) { diff --git a/src/templates/index.html b/src/templates/index.html index 368aa3a80..62a590a87 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -171,7 +171,7 @@ function go2Name() { - var padname = document.getElementById("padname").value.replace(/[^a-z0-9_\-]/gi, '_'); + var padname = document.getElementById("padname").value.replace(/[;\/\?:@&=\+\$,{}\\\^\[\]\`\|]/gi, '_'); padname.length > 0 ? window.location = "p/" + padname : alert("Please enter a name"); }