Adv item search: use encode/decodeURI rather than encode/decodeURIComponent
This commit is contained in:
parent
fe2844962f
commit
a6cfb4001a
1 changed files with 3 additions and 3 deletions
|
@ -96,7 +96,7 @@ function init() {
|
||||||
|
|
||||||
// update url query string
|
// update url query string
|
||||||
const newUrl = `${window.location.protocol}//${window.location.host}${window.location.pathname}`
|
const newUrl = `${window.location.protocol}//${window.location.host}${window.location.pathname}`
|
||||||
+ `?f=${encodeURIComponent(searchFilterField.value)}&s=${encodeURIComponent(searchSortField.value)}`;
|
+ `?f=${encodeURI(searchFilterField.value)}&s=${encodeURI(searchSortField.value)}`;
|
||||||
window.history.pushState({ path: newUrl }, '', newUrl);
|
window.history.pushState({ path: newUrl }, '', newUrl);
|
||||||
|
|
||||||
// hide old search results
|
// hide old search results
|
||||||
|
@ -174,10 +174,10 @@ function init() {
|
||||||
if (ndx !== -1) {
|
if (ndx !== -1) {
|
||||||
switch (entryStr.substring(0, ndx)) {
|
switch (entryStr.substring(0, ndx)) {
|
||||||
case 'f':
|
case 'f':
|
||||||
searchFilterField.field.value = decodeURIComponent(entryStr.substring(ndx + 1));
|
searchFilterField.field.value = decodeURI(entryStr.substring(ndx + 1));
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
searchSortField.field.value = decodeURIComponent(entryStr.substring(ndx + 1));
|
searchSortField.field.value = decodeURI(entryStr.substring(ndx + 1));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue