Validate pathtoebook

This commit is contained in:
Kovid Goyal 2019-10-31 08:57:39 +05:30
parent 74d97ca869
commit f1db7eab2f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -27,7 +27,9 @@ def create_open_book(container, book):
for entry in rl: for entry in rl:
if book and book.manifest.pathtoebook is entry.pathtoebook: if book and book.manifest.pathtoebook is entry.pathtoebook:
continue continue
fname = str.replace(entry.pathtoebook, '\\', '/') if jstype(entry.pathtoebook) is not 'string':
continue
fname = entry.pathtoebook.replace(/\\/g, '/')
if '/' in fname: if '/' in fname:
fname = fname.rpartition('/')[-1] fname = fname.rpartition('/')[-1]
items.push(create_item(entry.title, ui_operations.ask_for_open.bind(None, entry.pathtoebook), fname)) items.push(create_item(entry.title, ui_operations.ask_for_open.bind(None, entry.pathtoebook), fname))