Skip to content

Commit

Permalink
Pie: Field names are not escaped in expression (#98115) (#98909)
Browse files Browse the repository at this point in the history
* Pie: Field names are not escaped in expression

* Add a test case for single and double quotes to pie_fn.test

* Revert pie_fn and its test, remove escaping for vis config

* Update to_ast_pie

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
DianaDerevyankina and kibanamachine authored Apr 30, 2021
1 parent 607ef56 commit 6fdcfc6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/plugins/vis_type_vislib/public/to_ast_pie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ export const toExpressionAst: VisToExpressionAst<PieVisParams> = async (vis, par
},
};

const configStr = JSON.stringify(visConfig).replace(/\\/g, `\\\\`).replace(/'/g, `\\'`);
const visTypePie = buildExpressionFunction<VisTypeVislibPieExpressionFunctionDefinition>(
vislibPieName,
{
visConfig: configStr,
visConfig: JSON.stringify(visConfig),
}
);

Expand Down

0 comments on commit 6fdcfc6

Please sign in to comment.