diff --git a/app/src/main/java/com/example/research/core/domain/model/DictionarySource.kt b/app/src/main/java/com/example/research/core/domain/model/DictionarySource.kt index 707d92e..7df0ce1 100644 --- a/app/src/main/java/com/example/research/core/domain/model/DictionarySource.kt +++ b/app/src/main/java/com/example/research/core/domain/model/DictionarySource.kt @@ -132,8 +132,15 @@ data class DictionarySource( val parts = afterProtocol.split("/") if (parts.size < 2) return false - val domain = parts[0] - if (domain.isEmpty()) return false + val hostWithPort = parts[0] + if (hostWithPort.isEmpty()) return false + + val colonIndex = hostWithPort.lastIndexOf(':') + if (colonIndex >= 0) { + val port = hostWithPort.substring(colonIndex + 1).toIntOrNull() + if (port == null || port !in 1..65535) return false + } + val domain = if (colonIndex >= 0) hostWithPort.substring(0, colonIndex) else hostWithPort if (domain != "localhost" && !domain.contains(".")) return false val filename = parts.last()