Explorar el Código

fix(elasticsearch): fixed templating lucene / json escaping issue, fixes #5228, fixes #5227

Torkel Ödegaard hace 9 años
padre
commit
38790e2c4b
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      public/app/plugins/datasource/elasticsearch/datasource.js

+ 3 - 1
public/app/plugins/datasource/elasticsearch/datasource.js

@@ -205,7 +205,9 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes
     };
 
     function escapeForJson(value) {
-      return value.replace(/\"/g, '\\"');
+      return value
+        .replace(/\s/g, '\\ ')
+        .replace(/\"/g, '\\"');
     }
 
     function luceneThenJsonFormat(value) {