mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 06:21:31 +01:00
Fixed bug: Properly escape search string for regex
E.g. searching for [ caused a crash.
This commit is contained in:
parent
3bba7cfe74
commit
b8ef2a07c2
1 changed files with 2 additions and 2 deletions
|
@ -5,7 +5,7 @@ import de.jrpie.android.launcher.actions.AppAction
|
|||
import de.jrpie.android.launcher.actions.Gesture
|
||||
import de.jrpie.android.launcher.preferences.LauncherPreferences
|
||||
import java.util.Locale
|
||||
import kotlin.text.Regex.Companion.escapeReplacement
|
||||
import kotlin.text.Regex.Companion.escape
|
||||
|
||||
class AppFilter(
|
||||
var search: String,
|
||||
|
@ -37,7 +37,7 @@ class AppFilter(
|
|||
.toCharArray()
|
||||
.distinct()
|
||||
.filter { c -> !c.isLetter() }
|
||||
.map { c -> escapeReplacement(c.toString()) }
|
||||
.map { c -> escape(c.toString()) }
|
||||
.fold("") { x, y -> x + y }
|
||||
val disallowedCharsRegex = "[^\\p{L}$allowedSpecialCharacters]".toRegex()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue