mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-02-12 15:48:40 +00:00
partially fix url encoding
This commit is contained in:
parent
dd4728e880
commit
72e6c97965
|
|
@ -130,6 +130,8 @@ export class UriFactory
|
||||||
const parts = url.replace(/\?/g, '&').split('&'),
|
const parts = url.replace(/\?/g, '&').split('&'),
|
||||||
full = parts[0];
|
full = parts[0];
|
||||||
|
|
||||||
|
// @todo: handle fragment
|
||||||
|
|
||||||
if (parts.length > 1) {
|
if (parts.length > 1) {
|
||||||
parts.shift();
|
parts.shift();
|
||||||
|
|
||||||
|
|
@ -145,7 +147,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 + '=' + encodeURIComponent(comps[a]));
|
pars.push(a + '=' + encodeURIComponent(comps[a]).replace(/%25/ig, '%'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -156,6 +158,8 @@ export class UriFactory
|
||||||
const fragments = url.match(/\#[a-zA-Z0-9\-,]+/g),
|
const fragments = url.match(/\#[a-zA-Z0-9\-,]+/g),
|
||||||
fragLength = fragments !== null ? fragments.length : 0;
|
fragLength = fragments !== null ? fragments.length : 0;
|
||||||
|
|
||||||
|
// @todo: don't remove fragments, some might be used = none tab fragments
|
||||||
|
|
||||||
for (let i = 0; i < fragLength - 1; ++i) {
|
for (let i = 0; i < fragLength - 1; ++i) {
|
||||||
// remove all from old url
|
// remove all from old url
|
||||||
url = url.replace(fragments[i], '');
|
url = url.replace(fragments[i], '');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user