Commit Graph

10 Commits

Author SHA1 Message Date
Dominik
cec0178e76 fix: encode dots in URL path segments to prevent browser resolution (#3308)
When editing a regex domain that is just "." (single dot), the browser
interprets it as a relative path component ("current directory") and
resolves it away before sending the request. The server receives an
empty string, causing "Invalid request: Specify item in URI".

This happens because encodeURIComponent(".") returns "." unchanged —
dots are unreserved characters per RFC 3986. The browser only normalizes
literal "." and ".." path segments, not percent-encoded "%2E".

Add utils.encodePathSegment() which wraps encodeURIComponent and also
encodes dots to %2E, then apply it in groups-domains.js (the reported
bug) and groups.js (which was also missing encoding entirely).

Fixes #3308

Signed-off-by: Dominik <dl6er@dl6er.de>
2026-03-25 07:04:28 +01:00
yubiuser
c02e66fe04 Fix xo errors
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-03-16 08:55:20 +01:00
XhmikosR
9c00467a6d utils: remove duplicate function and convert changeTableButtonStates to vanilla JS
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-07-01 16:38:57 +03:00
XhmikosR
756239a6dd xo: enable strict mode
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-04-23 20:50:12 +03:00
XhmikosR
f598a8e35c Manual xo fixes and suppressions
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-04-23 07:53:16 +03:00
XhmikosR
f8a0a1d4ec Tighten xo rules
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-04-23 07:53:13 +03:00
DL6ER
b524a2f4b6 Always use document.body.dataset.apiurl instead of the intermediate const apiUrl
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-03-31 22:00:16 +02:00
DL6ER
a7f1ca7800 Allow path prefix multiplexing the dashboard and API. See https://github.com/pi-hole/FTL/pull/2319 for further details
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-03-02 20:20:10 +01:00
DL6ER
f91e8a0f49 Fix ability to add groups with spaces in them if thy are enclosed in quotes
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-23 18:06:00 +01:00
yubiuser
1e922a8b29 Move all files from /scripts/pi-hole/ to /scripts/
Signed-off-by: yubiuser <github@yubiuser.dev>
2024-10-28 20:22:09 +01:00