浏览代码

Escape typeahead values in query_part

Sven Klemm 7 年之前
父节点
当前提交
20c1a58488
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      public/app/core/components/query_part/query_part_editor.ts

+ 2 - 1
public/app/core/components/query_part/query_part_editor.ts

@@ -103,7 +103,7 @@ export function queryPartEditorDirective($compile, templateSrv) {
           $scope.$apply(() => {
             $scope.handleEvent({ $event: { name: 'get-param-options' } }).then(result => {
               const dynamicOptions = _.map(result, op => {
-                return op.value;
+                return _.escape(op.value);
               });
               callback(dynamicOptions);
             });
@@ -117,6 +117,7 @@ export function queryPartEditorDirective($compile, templateSrv) {
           minLength: 0,
           items: 1000,
           updater: value => {
+            value = _.unescape(value);
             setTimeout(() => {
               inputBlur.call($input[0], paramIndex);
             }, 0);