@ -231,7 +231,9 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions {
if (result == null) result = ""
val str = kotlin.runCatching {
Entities.unescape(result.toString())
}.getOrDefault(result.toString())
}.getOrElse {
result.toString()
}
if (isUrl) {
return if (str.isBlank()) {
baseUrl ?: ""
@ -214,12 +214,11 @@ object StringUtils {
fun stringToInt(str: String?): Int {
if (str != null) {
val num = fullToHalf(str).replace("\\s+".toRegex(), "")
return try {
return kotlin.runCatching {
Integer.parseInt(num)
} catch (e: Exception) {
chineseNumToInt(num)
return -1