@marcel91200 / caddy Mirror · read-only / commits / 5d8b45c9
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 12, 14:30 UTC

fileserver: Escape # and ? in img src (fix #6237)

Matthew Holt committed Apr 12, 2024 at 15:59 UTC 5d8b45c9fbbd40c5c1a43f23a6d0c2f284d2b6ba
1 file changed +1 -1
modules/caddyhttp/fileserver/browse.html
+1 -1
@@ -21,7 +21,7 @@
21 </svg>
22 {{- else if .HasExt ".jpg" ".jpeg" ".png" ".gif" ".webp" ".tiff" ".bmp" ".heif" ".heic" ".svg"}}
23 {{- if eq .Tpl.Layout "grid"}}
24 - <img loading="lazy" src="{{html .Name}}">
24 + <img loading="lazy" src="{{.Name | replace "#" "%23" | replace "?" "%3f" | html}}">
25 {{- else}}
26 <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-photo" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
27 <path stroke="none" d="M0 0h24v24H0z" fill="none"/>