mirror of
https://github.com/Fabio286/antares.git
synced 2025-01-11 08:34:30 +01:00
fix: % character not properly escaped, closes #60
This commit is contained in:
parent
fd4f032a6f
commit
ecfb732c26
@ -12,7 +12,7 @@ const regex = new RegExp(pattern);
|
||||
function sqlEscaper (string) {
|
||||
return string.replace(regex, char => {
|
||||
const m = ['\\0', '\\x08', '\\x09', '\\x1a', '\\n', '\\r', '\'', '\"', '\\', '\\\\', '%'];
|
||||
const r = ['\\\\0', '\\\\b', '\\\\t', '\\\\z', '\\\\n', '\\\\r', '\\\'', '\\\"', '\\\\', '\\\\\\\\', '\\%'];
|
||||
const r = ['\\\\0', '\\\\b', '\\\\t', '\\\\z', '\\\\n', '\\\\r', '\\\'', '\\\"', '\\\\', '\\\\\\\\', '\%'];
|
||||
return r[m.indexOf(char)] || char;
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user