fix query param encoding

This commit is contained in:
Dennis Eichhorn 2020-05-02 21:02:46 +02:00
parent f0d34f3dbd
commit 0179c6f8c0

View File

@ -145,7 +145,7 @@ export class UriFactory
let pars = []; let pars = [];
for (const a in comps) { for (const a in comps) {
if (comps.hasOwnProperty(a) && comps[a] !== '' && comps[a] !== null) { if (comps.hasOwnProperty(a) && comps[a] !== '' && comps[a] !== null) {
pars.push(a + '=' + comps[a]); pars.push(a + '=' + encodeURIComponent(comps[a]));
} }
} }
@ -196,7 +196,10 @@ export class UriFactory
} else if (match.indexOf('#') === 0) { } else if (match.indexOf('#') === 0) {
const e = document.getElementById(match.substr(1)); const e = document.getElementById(match.substr(1));
if (e) { if (!e) {
return '';
}
if (e.tagName.toLowerCase() !== 'form') { if (e.tagName.toLowerCase() !== 'form') {
return e.value; return e.value;
} }
@ -209,9 +212,6 @@ export class UriFactory
} }
return value; return value;
}
return '';
} else if (match.indexOf('?') === 0) { } else if (match.indexOf('?') === 0) {
return HttpUri.getUriQueryParameter(current.query, match.substr(1)); return HttpUri.getUriQueryParameter(current.query, match.substr(1));
} else if (match.indexOf('/') === 0) { } else if (match.indexOf('/') === 0) {