From 38e2c040d175a4171ed469fb9f2fc210d93da5bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 14 Sep 2017 16:45:45 +0200 Subject: [PATCH] Use template string to escape literals --- lib/cartodb/models/dataview/aggregation.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/cartodb/models/dataview/aggregation.js b/lib/cartodb/models/dataview/aggregation.js index c7626736..29eebe06 100644 --- a/lib/cartodb/models/dataview/aggregation.js +++ b/lib/cartodb/models/dataview/aggregation.js @@ -292,8 +292,7 @@ module.exports = class Aggregation extends BaseDataview { search (psql, userQuery, callback) { const self = this; - - const escapedUserQuery = psql.escapeLiteral('%' + userQuery + '%'); + const escapedUserQuery = psql.escapeLiteral(`%${userQuery}%`); const value = this.aggregation !== 'count' && this.aggregationColumn ? this.aggregation + '(' + this.aggregationColumn + ')' : 'count(1)';