You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// now handle the rest that decodeURIComponent would do
params[key]=params[key]
.replace(/%23/g,'#')
.replace(/%3[Bb]/g,';')
.replace(/%2[Cc]/g,',')
.replace(/%2[Ff]/g,'/')
.replace(/%3[Ff]/g,'?')
.replace(/%3[Aa]/g,':')
.replace(/%40/g,'@')
.replace(/%26/g,'&')
.replace(/%3[Dd]/g,'=')
.replace(/%2[Bb]/g,'+')
.replace(/%24/g,'$');
}
returnparams;
}
decodeURI decodes %25 as %, but doesn't decodes all symbols (unlike decodeURIComponent). Missed symbols are decoded by decode_params, which is wrong, because decoded % followed by some characters is decoded again.
Describe the bug
This function receives record, that contains params, parsed from pathname, which was previously processed with
decodeURI
.kit/packages/kit/src/utils/url.js
Lines 58 to 77 in ec601bc
decodeURI
decodes%25
as%
, but doesn't decodes all symbols (unlikedecodeURIComponent
). Missed symbols are decoded bydecode_params
, which is wrong, because decoded % followed by some characters is decoded again.Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-v5eg8a
goto /%25
,param: %
expected ✅goto /%2526
,param: %26
expected ❌Logs
No response
System Info
Severity
annoyance
Additional Information
I'd like to make a PR
The text was updated successfully, but these errors were encountered: