Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Commit

Permalink
Avoid error when user enters ' or "
Browse files Browse the repository at this point in the history
Escape ' and " characters to avoid errors when the user would enter
these in the input field.
  • Loading branch information
JelleDekker committed Feb 21, 2018
1 parent 6d79073 commit 4a00591
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ComboSelector/lib/XpathStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ define([
getResults: function (query) {
logger.debug(this.id + ".getResults");
if (query.name) {
var xpathQuery = this.dataSourceXpath + "[contains(" + this.associationDisplay + ", '" + query.name.replace(/\'/g, ''').replace(/\"/g, '"') + "')]";
var
searchString = query.name.toString().replace(/\'/g, ''').replace(/\"/g, '"'),
xpathQuery = this.dataSourceXpath + "[contains(" + this.associationDisplay + ", '" + searchString + "')]";
mx.data.get({
xpath: xpathQuery,
filter: {
Expand Down
Binary file modified test/widgets/ComboSelector.mpk
Binary file not shown.

0 comments on commit 4a00591

Please sign in to comment.