mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Viewer: Fix failure to open some books that contain unparseable URLs. Fixes #1858836 [Viewer Crashes on "Invalid IPv6 URL"](https://bugs.launchpad.net/calibre/+bug/1858836)
This commit is contained in:
parent
39a9c123a2
commit
dffc39cf0c
@ -106,7 +106,10 @@ def create_link_replacer(container, link_uid, changed):
|
||||
return url
|
||||
changed.add(base)
|
||||
return resource_template.format(encode_url(base, frag))
|
||||
try:
|
||||
purl = urlparse(url)
|
||||
except Exception:
|
||||
return url
|
||||
if purl.netloc or purl.query:
|
||||
return url
|
||||
if purl.scheme and purl.scheme != 'file':
|
||||
|
Loading…
x
Reference in New Issue
Block a user