From 46d5fa2776ed6e29882b458f4154897dfe262545 Mon Sep 17 00:00:00 2001 From: Artem Chepurnoy Date: Sun, 7 Jan 2024 22:36:38 +0200 Subject: [PATCH] fix: Implement {url:userinfo} placeholder corrently --- .../common/service/placeholder/impl/UrlPlaceholder.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/placeholder/impl/UrlPlaceholder.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/placeholder/impl/UrlPlaceholder.kt index 5aac542f..3cb3d693 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/placeholder/impl/UrlPlaceholder.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/placeholder/impl/UrlPlaceholder.kt @@ -24,8 +24,8 @@ class UrlPlaceholder( url.replace(regex, "").let(::io) } - key.equals("url:scm", ignoreCase = true) || - key.equals("base:scm", ignoreCase = true)-> { + key.equals("url:scm", ignoreCase = true) || + key.equals("base:scm", ignoreCase = true) -> { uuu.protocol.name .let(::io) } @@ -57,7 +57,9 @@ class UrlPlaceholder( key.equals("url:userinfo", ignoreCase = true) || key.equals("base:userinfo", ignoreCase = true) -> { - "todo" + val user = uuu.user.orEmpty() + val password = uuu.password.orEmpty() + "$user:$password" .let(::io) }