mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 03:14:40 -05:00
Extract downloaded webUI zip in temp folder for validation (#744)
Could cause issues due to not having permission to create the folder to extract the zip into
This commit is contained in:
@@ -613,16 +613,13 @@ object WebInterfaceManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isDownloadValid(zipFile.name, filePath)) {
|
if (!isDownloadValid(filePath)) {
|
||||||
throw Exception("Download is invalid")
|
throw Exception("Download is invalid")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun isDownloadValid(
|
private suspend fun isDownloadValid(zipFilePath: String): Boolean {
|
||||||
zipFileName: String,
|
val tempUnzippedWebUIFolderPath = zipFilePath.replace(".zip", "")
|
||||||
zipFilePath: String,
|
|
||||||
): Boolean {
|
|
||||||
val tempUnzippedWebUIFolderPath = zipFileName.replace(".zip", "")
|
|
||||||
|
|
||||||
extractDownload(zipFilePath, tempUnzippedWebUIFolderPath)
|
extractDownload(zipFilePath, tempUnzippedWebUIFolderPath)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user