mirror of
https://github.com/DerTyp7/notes-react.git
synced 2025-10-30 21:07:10 +01:00
secure user input
This commit is contained in:
13
express_backend/securePostData.js
Normal file
13
express_backend/securePostData.js
Normal file
@@ -0,0 +1,13 @@
|
||||
function secure(text){
|
||||
text = text.replace(/'/g, "\\u0027");
|
||||
return text;
|
||||
}
|
||||
|
||||
function decode(text){
|
||||
text = text.replace(/\\u0027/g, "'");
|
||||
return text;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
secure, decode
|
||||
}
|
||||
Reference in New Issue
Block a user