diff --git a/public/assets/components/breadcrumb.js b/public/assets/components/breadcrumb.js index a6490c3e..11623786 100644 --- a/public/assets/components/breadcrumb.js +++ b/public/assets/components/breadcrumb.js @@ -119,7 +119,7 @@ class ComponentBreadcrumb extends HTMLElement { return `
- + ${tmpl}
diff --git a/public/assets/components/sidebar.js b/public/assets/components/sidebar.js index 4a9e8100..99a8371d 100644 --- a/public/assets/components/sidebar.js +++ b/public/assets/components/sidebar.js @@ -168,7 +168,7 @@ async function _createListOfFiles(path, currentName, fullpath) { const currpath = path + whats[i] + "/"; const $li = createElement(`
  • - + directory
    ${whats[i]}
    diff --git a/public/assets/lib/path.js b/public/assets/lib/path.js index ba87450d..930cb3d7 100644 --- a/public/assets/lib/path.js +++ b/public/assets/lib/path.js @@ -7,7 +7,8 @@ export function extname(str) { } export function join(baseURL, segment) { - return new URL(segment, baseURL).pathname; + const url = new URL(segment, baseURL); + return decodeURIComponent(url.pathname + url.hash); } export function forwardURLParams(url, allowed = []) { diff --git a/public/assets/pages/filespage/ctrl_filesystem.js b/public/assets/pages/filespage/ctrl_filesystem.js index cfc5b239..7a3c954f 100644 --- a/public/assets/pages/filespage/ctrl_filesystem.js +++ b/public/assets/pages/filespage/ctrl_filesystem.js @@ -329,7 +329,7 @@ function createLink(file, currentPath) { let path = file.path; if (!path) path = currentPath + file.name + (file.type === "directory" ? "/" : ""); let link = file.type === "directory" ? "files" + path : "view" + path; - link = link.replaceAll("#", "%23"); + link = encodeURIComponent(link).replaceAll("%2F", "/"); return { path, link, diff --git a/public/assets/pages/filespage/modal_share.js b/public/assets/pages/filespage/modal_share.js index 8513fdee..26b857b5 100644 --- a/public/assets/pages/filespage/modal_share.js +++ b/public/assets/pages/filespage/modal_share.js @@ -183,9 +183,10 @@ async function ctrlListShares(render, { load, remove, all, formLinks }) { } async function ctrlCreateShare(render, { save, formState }) { + const enc = (p) => encodeURIComponent(p).replaceAll("%2F", "/"); if (formState.path) formState.path = join( - location.origin + currentPath(), - formState.path, + location.origin + enc(currentPath()), + enc(formState.path), ); let id = formState.id || randomString(7); const $page = createElement(`