From 6998b93f26f7c4d0388da7300a20b4373a308588 Mon Sep 17 00:00:00 2001 From: nsantacruz Date: Mon, 2 May 2022 07:04:27 +0300 Subject: [PATCH] decode uri path before manipulating --- static/js/ReaderApp.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/ReaderApp.jsx b/static/js/ReaderApp.jsx index 7375e59418..c4baf1b83b 100644 --- a/static/js/ReaderApp.jsx +++ b/static/js/ReaderApp.jsx @@ -1009,7 +1009,7 @@ class ReaderApp extends Component { window.open(url, '_blank') return true; } - const path = url.pathname; + const path = decodeURI(url.pathname); const params = url.searchParams; const openPanel = replace ? this.openPanel : this.openPanelAtEnd; if (path === "/") { @@ -1025,7 +1025,7 @@ class ReaderApp extends Component { this.showSaved(); } else if (path.match(/\/texts\/.+/)) { - this.showLibrary(path.slice(7).split("/").map(decodeURI)); + this.showLibrary(path.slice(7).split("/")); } else if (path === "/collections") { this.showCollections();