mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix crash when downloading books with unknown characters in title (#2628)
This commit is contained in:
@@ -256,11 +256,15 @@ function util.getFilesystemType(path)
|
||||
end
|
||||
|
||||
function util.replaceInvalidChars(str)
|
||||
return str:gsub('[\\,%/,:,%*,%?,%",%<,%>,%|]','_')
|
||||
if str then
|
||||
return str:gsub('[\\,%/,:,%*,%?,%",%<,%>,%|]','_'):gsub("([\224-\244]+)",'_')
|
||||
end
|
||||
end
|
||||
|
||||
function util.replaceSlashChar(str)
|
||||
return str:gsub('%/','_')
|
||||
if str then
|
||||
return str:gsub('%/','_'):gsub("([\224-\244]+)",'_')
|
||||
end
|
||||
end
|
||||
|
||||
-- Split a file into its path and name
|
||||
|
||||
Reference in New Issue
Block a user