From 980df2b3a7bc35f55a1f91d0986cdec9f7ecd166 Mon Sep 17 00:00:00 2001 From: Sarun Rattanasiri Date: Tue, 14 Jan 2025 17:24:48 +0700 Subject: [PATCH] fix hostname matching logic --- src/Kp2aBusinessLogic/SearchDbHelper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Kp2aBusinessLogic/SearchDbHelper.cs b/src/Kp2aBusinessLogic/SearchDbHelper.cs index a51e0b7a1..b21d271b8 100644 --- a/src/Kp2aBusinessLogic/SearchDbHelper.cs +++ b/src/Kp2aBusinessLogic/SearchDbHelper.cs @@ -138,7 +138,8 @@ public PwGroup SearchForHost(Database database, String url, bool allowSubdomains { continue; } - if (host.IndexOf(otherHost, StringComparison.InvariantCultureIgnoreCase) > -1) + if (string.Equals(host, otherHost, StringComparison.OrdinalIgnoreCase) || + host.EndsWith("." + otherHost, StringComparison.OrdinalIgnoreCase)) { pgResults.AddEntry(entry, false); }