Skip to content

Commit

Permalink
www: fix playback of files with special characters
Browse files Browse the repository at this point in the history
Apparently setting a player source with a file name containing a "&" does
not work, as the "&" is not escaped (but a "&" in the path leading up to
the file *is* escaped). Escape the entire source path just to be safe.
  • Loading branch information
marcone committed Aug 14, 2024
1 parent 8a53ff5 commit 29c23ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion teslausb-www/html/filebrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ class FileBrowser {
div.style.background = "#0008";
div.onclick = (e) => { if (e.target === div) div.remove(); };
document.firstElementChild.append(div);
div.innerHTML = `<div class="fb-player"><div class="fb-playertitle">${displaypath}</div><audio autoplay controls src="${this.root_path}/${path}"></div>`;
div.innerHTML = `<div class="fb-player"><div class="fb-playertitle">${displaypath}</div><audio autoplay controls src="${encodeURIComponent(this.root_path + "/" + path)}"></div>`;
div.querySelector(".fb-playertitle").scrollLeft=1000;
}
}
Expand Down

0 comments on commit 29c23ad

Please sign in to comment.