Skip to content

Commit

Permalink
#1061 Escape quotes from case list filters
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani authored and To-om committed Apr 6, 2020
1 parent ebf883c commit ed884dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ui/app/scripts/controllers/case/CaseListCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@
self.caseResponders = responders;
})
.catch(function(err) {
NotificationSrv.error('CaseList', response.data, response.status);
})
NotificationSrv.error('CaseList', err.data, err.status);
});
};

this.runResponder = function(responderId, responderName, caze) {
Expand Down
6 changes: 3 additions & 3 deletions ui/app/scripts/services/CasesUISrv.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@

// Prepare the filter value
if (field === 'keyword') {
query = value;
query = value.replace(/"/gi, '\\"');
} else if (angular.isArray(value) && value.length > 0) {
query = _.map(value, function(val) {
return field + ':"' + convertFn(val.text) + '"';
return field + ':"' + convertFn(val.text.replace(/"/gi, '\\"')) + '"';
}).join(' OR ');
query = '(' + query + ')';
} else if (filterDef.type === 'date') {
Expand All @@ -178,7 +178,7 @@
query = field + ':[ ' + fromDate + ' TO ' + toDate + ' ]';

} else {
query = field + ':' + convertFn(value);
query = field + ':' + convertFn(value.replace(/"/gi, '\\"'));
}

factory.filters[field] = {
Expand Down

0 comments on commit ed884dc

Please sign in to comment.