mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[fix, chore] Abstract filename logic in util.getSafeFilename() (#5026)
Fixes https://github.com/koreader/koreader/issues/5025
The OPDS browser was doing some fancier stuff in a way that should be abstracted away in util (because it applies anywhere files will be saved):
eace8d25c1/frontend/ui/widget/opdsbrowser.lua (L482-L491)
This commit is contained in:
@@ -616,7 +616,7 @@ function ReaderLink:onGoToExternalLink(link_url)
|
||||
-- wikipedia page saved as epub, full of wikipedia links, it's
|
||||
-- too easy to click on links when wanting to change page...)
|
||||
-- But first check if this wikipedia article has been saved as EPUB
|
||||
local epub_filename = util.replaceInvalidChars(wiki_page:gsub("_", " ")) .. "."..string.upper(wiki_lang)..".epub"
|
||||
local epub_filename = util.getSafeFilename(wiki_page:gsub("_", " ")) .. "."..string.upper(wiki_lang)..".epub"
|
||||
local epub_fullpath
|
||||
-- either in current book directory
|
||||
local last_file = G_reader_settings:readSetting("lastfile")
|
||||
|
||||
Reference in New Issue
Block a user