mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 01:23:32 -06:00
fix variable escaping
This commit is contained in:
parent
a2f4441f9d
commit
907e8fd77c
@ -48,7 +48,11 @@ export default class PostgresQuery {
|
||||
}
|
||||
|
||||
quoteLiteral(value) {
|
||||
return "'" + value.replace("'", "''") + "'";
|
||||
return "'" + this.escapeLiteral(value) + "'";
|
||||
}
|
||||
|
||||
escapeLiteral(value) {
|
||||
return value.replace("'", "''");
|
||||
}
|
||||
|
||||
hasTimeGroup() {
|
||||
@ -62,7 +66,7 @@ export default class PostgresQuery {
|
||||
interpolateQueryStr(value, variable, defaultFormatFn) {
|
||||
// if no multi or include all do not regexEscape
|
||||
if (!variable.multi && !variable.includeAll) {
|
||||
return value;
|
||||
return this.escapeLiteral(value);
|
||||
}
|
||||
|
||||
if (typeof value === 'string') {
|
||||
|
Loading…
Reference in New Issue
Block a user