mirror of
https://github.com/Corewala/Buran
synced 2025-03-08 04:44:06 +00:00
Fixed crash if whitespace present in addressbar
This commit is contained in:
parent
c23b3efb70
commit
0a59ac08cb
1 changed files with 5 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
package corewala.buran
|
||||
|
||||
import android.net.Uri
|
||||
import android.webkit.URLUtil
|
||||
import java.util.*
|
||||
|
||||
const val GEM_SCHEME = "gemini://"
|
||||
|
@ -16,6 +17,10 @@ class OmniTerm(private val listener: Listener) {
|
|||
*/
|
||||
fun input(term: String, searchbase: String?){
|
||||
when {
|
||||
term.contains(" ") -> {
|
||||
val encoded = Uri.encode(term)
|
||||
listener.request("$searchbase$encoded")
|
||||
}
|
||||
term.startsWith(GEM_SCHEME) && term != GEM_SCHEME -> {
|
||||
listener.request(term)
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue