diff --git a/src/App/Pages/Vault/AutofillCiphersPageViewModel.cs b/src/App/Pages/Vault/AutofillCiphersPageViewModel.cs index b69c31cb5..7a8e93292 100644 --- a/src/App/Pages/Vault/AutofillCiphersPageViewModel.cs +++ b/src/App/Pages/Vault/AutofillCiphersPageViewModel.cs @@ -63,8 +63,11 @@ namespace Bit.App.Pages { name = Uri.Substring(Constants.AndroidAppProtocol.Length); } - else if(!System.Uri.TryCreate(Uri, UriKind.Absolute, out Uri uri) || - !DomainName.TryParseBaseDomain(uri.Host, out name)) + else + { + name = CoreHelpers.GetDomain(Uri); + } + if(string.IsNullOrWhiteSpace(name)) { name = "--"; } diff --git a/src/Core/Utilities/CoreHelpers.cs b/src/Core/Utilities/CoreHelpers.cs index 30770289c..a999271da 100644 --- a/src/Core/Utilities/CoreHelpers.cs +++ b/src/Core/Utilities/CoreHelpers.cs @@ -63,7 +63,7 @@ namespace Bit.Core.Utilities return null; } - if(uri.Host == "localhost" || Regex.IsMatch(uriString, IpRegex)) + if(uri.Host == "localhost" || Regex.IsMatch(uri.Host, IpRegex)) { return uri.Host; }