mirror of
https://github.com/zensical/zensical.git
synced 2026-08-25 16:46:43 +00:00
fix: don't crash on invalid URLs in HTML (#755)
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
This commit is contained in:
@@ -191,7 +191,10 @@ def _is_relative(value: str) -> bool:
|
||||
return False
|
||||
|
||||
# Absolute URLs (e.g. `https://example.com`) and protocol-relative URLs
|
||||
url = urlparse(value)
|
||||
try:
|
||||
url = urlparse(value)
|
||||
except ValueError:
|
||||
return False
|
||||
if url.scheme or url.netloc or url.path.startswith("/"):
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user