Escaping question mark in manticore query to prevent conflict with manticore and knex syntax.
This commit is contained in:
@@ -4,8 +4,10 @@ export default function escape(string) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return string
|
||||
const replaced = string
|
||||
.replace(/\\/g, String.raw`\\\\`) // using String.raw so we don't have to double up JS and SQL escaping
|
||||
.replace(/'/g, String.raw`\'`)
|
||||
.replace(/(["!$()/<@^|~-])/g, String.raw`\\$1`);
|
||||
.replace(/(["?!$()/<@^|~-])/g, String.raw`\\$1`);
|
||||
|
||||
return replaced;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user