Skip to content

Commit

Permalink
Merge pull request #2051 from IgniteUI/use-encodeUriComponent-192
Browse files Browse the repository at this point in the history
Use encodeUriComponent instaead of escape to encode filtering params in URL
  • Loading branch information
Lipata authored Feb 24, 2020
2 parents e5a1d01 + 1e40b3d commit a9a945a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/js/modules/infragistics.datasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
*/

/*global Class, ActiveXObject, DOMParser, XPathResult, XMLSerializer, escape */
/*global Class, ActiveXObject, DOMParser, XPathResult, XMLSerializer */
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down Expand Up @@ -5025,7 +5025,7 @@
);
/* d = ffields[i].expr.getTime(); */
} else {
d = escape(ffields[ i ].expr);
d = encodeURIComponent(ffields[ i ].expr);
}
if (params.filteringParams[ key ] === undefined) {
params.filteringParams[ key ] = ffields[ i ].cond +
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/dataSource/properties/properties-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ QUnit.module("igDataSource Properties", {
var nYear = nextMonthDate.getFullYear();
var prevMonthYear = prevMonthDate.getFullYear();

var params = unescape($.param(dsFilter._encodeUrl()));
var params = decodeURIComponent($.param(dsFilter._encodeUrl()));
assert.equal(params,
"$filter=day(Date) eq " + date.getDate().toString() + " and month(Date) eq " + currMonth.toString() + " and year(Date) eq " + date.getFullYear().toString() +
" and month(Date2) eq " + prevMonth.toString() + " and year(Date2) eq " + prevMonthYear.toString() + " and month(Date3) eq " +
Expand Down
9 changes: 6 additions & 3 deletions tests/unit/dataSource/remote/remote-test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a9a945a

Please sign in to comment.