diff options
Diffstat (limited to 'js/functions.js')
-rw-r--r-- | js/functions.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/js/functions.js b/js/functions.js index eefbca9..98609cd 100644 --- a/js/functions.js +++ b/js/functions.js @@ -121,4 +121,17 @@ function str_pad (input, pad_length, pad_string, pad_type) { return input;
}
-
+function addslashes(str) {
+str=str.replace(/\\/g,'\\\\');
+str=str.replace(/\'/g,'\\\'');
+str=str.replace(/\"/g,'\\"');
+str=str.replace(/\0/g,'\\0');
+return str;
+}
+function stripslashes(str) {
+str=str.replace(/\\'/g,'\'');
+str=str.replace(/\\"/g,'"');
+str=str.replace(/\\0/g,'\0');
+str=str.replace(/\\\\/g,'\\');
+return str;
+}
|