Ox.decodeURI/Ox.decodeURIComponent: handle multi-byte escapes

This commit is contained in:
rlx 2013-08-14 20:00:14 +00:00
parent b0280295d2
commit c5a8d7a79e

View file

@ -30,7 +30,7 @@ Ox.decodeURIComponent <f> Decodes URI
(string) -> <s> Decoded string
@*/
Ox.decodeURI = function(string) {
return decodeURIComponent(string.replace(/%(?![0-7][0-9A-F])/g, '%25'));
return decodeURIComponent(string.replace(/%(?![0-9A-F]{2})/g, '%25'));
};
/*@
@ -39,7 +39,7 @@ Ox.decodeURIComponent <f> Decodes URI component
(string) -> <s> Decoded string
@*/
Ox.decodeURIComponent = function(string) {
return decodeURIComponent(string.replace(/%(?![0-7][0-9A-F])/g, '%25'));
return decodeURIComponent(string.replace(/%(?![0-9A-F]{2})/g, '%25'));
};
/*@