You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the grid view of the file browser's default template, if the filename of an image contains the characters # or ?, the preview doesn't appear, since web browsers (at least Firefox and Chromium) parse the src attribute as an URL. The href attribute pointing to the file itself is unaffected, so it remains possible to click on these files to open them, only the preview is broken.
The text was updated successfully, but these errors were encountered:
DenebTM
changed the title
fileserver: grid view - img src tag is not URL query-escaped
fileserver: grid view - preview img src attribute is not URL query-escaped
Apr 12, 2024
DenebTM
added a commit
to DenebTM/netdeneb
that referenced
this issue
Apr 12, 2024
A literal % needs to be encoded as %25, else any filename containing a percent followed by hexadecimal digits will break. And although it doesn't seem to be an issue, & should be encoded as %26 for completeness' sake.
Tbh I was kind of anticipating less of a "quick and dirty" fix than my own lol. It seems to me that a custom function wrapping Go's url.PathEscape should be added to the template module, since the closest built-in function urlquery from text/templates isn't quite suitable for escaping paths.
In the grid view of the file browser's default template, if the filename of an image contains the characters
#
or?
, the preview doesn't appear, since web browsers (at least Firefox and Chromium) parse thesrc
attribute as an URL. Thehref
attribute pointing to the file itself is unaffected, so it remains possible to click on these files to open them, only the preview is broken.The text was updated successfully, but these errors were encountered: