pull/2380/head
kunfei 2 years ago
parent ae39ec6051
commit 1a8ca99e42
  1. 2
      app/src/main/java/io/legado/app/help/AppWebDav.kt
  2. 28
      app/src/main/java/io/legado/app/utils/UrlUtil.kt

@ -230,7 +230,7 @@ object AppWebDav {
}
private fun getProgressUrl(name: String, author: String): String {
return bookProgressUrl + name + "_" + author + ".json"
return bookProgressUrl + UrlUtil.replaceReservedChar("${name}_${author}") + ".json"
}
/**

@ -0,0 +1,28 @@
package io.legado.app.utils
object UrlUtil {
fun replaceReservedChar(text: String): String {
return text.replace("%", "%25")
.replace(" ", "%20")
.replace("\"", "%22")
.replace("#", "%23")
.replace("&", "%26")
.replace("(", "%28")
.replace(")", "%29")
.replace("+", "%2B")
.replace(",", "%2C")
.replace("/", "%2F")
.replace(":", "%3A")
.replace(";", "%3B")
.replace("<", "%3C")
.replace("=", "%3D")
.replace(">", "%3E")
.replace("?", "%3F")
.replace("@", "%40")
.replace("\\", "%5C")
.replace("|", "%7C")
}
}
Loading…
Cancel
Save