зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1678298 - [devtools] Use decodeURIComponent instead of decodeURI r=bomsy
Depends on D98294 Differential Revision: https://phabricator.services.mozilla.com/D98388
This commit is contained in:
Родитель
5c7a830260
Коммит
398a8d1051
|
@ -88,7 +88,13 @@ function getUnicodeUrl(url) {
|
|||
return url;
|
||||
}
|
||||
const readableHostname = getUnicodeHostname(hostname);
|
||||
url = decodeURI(url);
|
||||
|
||||
/* We use `decodeURIComponent` instead of decodeURI as the
|
||||
* later does not decode some characters, it only can decode characters
|
||||
* previously encoded by the encodeURI. See
|
||||
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI#Description
|
||||
*/
|
||||
url = decodeURIComponent(url);
|
||||
return url.replace(hostname, readableHostname);
|
||||
} catch (err) {}
|
||||
return url;
|
||||
|
|
Загрузка…
Ссылка в новой задаче