mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit Book: Fix links that are absolute paths causing crashes in windows
This commit is contained in:
parent
acb6b24e93
commit
106d2cc2eb
@ -114,7 +114,10 @@ def set_book_locale(lang):
|
|||||||
def verify_link(url, name=None):
|
def verify_link(url, name=None):
|
||||||
if _current_container is None or name is None:
|
if _current_container is None or name is None:
|
||||||
return None
|
return None
|
||||||
|
try:
|
||||||
target = _current_container.href_to_name(url, name)
|
target = _current_container.href_to_name(url, name)
|
||||||
|
except ValueError:
|
||||||
|
return False # Absolute URLs that point to a different drive on windows cause this
|
||||||
if _current_container.has_name(target):
|
if _current_container.has_name(target):
|
||||||
return True
|
return True
|
||||||
if url.startswith('#'):
|
if url.startswith('#'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user