Skip to content

Commit fbeddca

Browse files
committed
Merge branch 'feature/26' into develop
2 parents befde15 + 5cac27f commit fbeddca

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

src/Simplify.String.Tests/StringHelperTests.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,11 @@ public void IsMobilePhoneValid()
3737
Assert.IsTrue(StringHelper.ValidateMobilePhone("+77015634321"));
3838
Assert.IsTrue(StringHelper.ValidateMobilePhone("+7015634321"));
3939
Assert.IsTrue(StringHelper.ValidateMobilePhone("+666567890345"));
40+
Assert.IsTrue(StringHelper.ValidateMobilePhone("+9944511122333"));
41+
Assert.IsTrue(StringHelper.ValidateMobilePhone("+9941234"));
4042

4143
Assert.IsFalse(StringHelper.ValidateMobilePhone(null));
42-
Assert.IsFalse(StringHelper.ValidateMobilePhone("+7707596754215"));
43-
Assert.IsFalse(StringHelper.ValidateMobilePhone("87075967543"));
44-
Assert.IsFalse(StringHelper.ValidateMobilePhone("+7 701 56 34 321"));
4544
Assert.IsFalse(StringHelper.ValidateMobilePhone("8 (701) 56 34 321"));
46-
Assert.IsFalse(StringHelper.ValidateMobilePhone("7072245456"));
47-
Assert.IsFalse(StringHelper.ValidateMobilePhone("2739956"));
48-
Assert.IsFalse(StringHelper.ValidateMobilePhone("273 99 56"));
4945
Assert.IsFalse(StringHelper.ValidateMobilePhone("+7701563432A"));
5046
Assert.IsFalse(StringHelper.ValidateMobilePhone("+7701563432*"));
5147
}

src/Simplify.String/Simplify.String.Sources.nuspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0"?>
1+
<?xml version="1.0" ?>
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata>
44
<id>Simplify.String.Sources</id>
@@ -12,8 +12,8 @@
1212
<description>String operations/validation functions</description>
1313
<summary>String operations/validation functions</summary>
1414
<releaseNotes>
15-
+ .NET Standard 2.0 support
16-
* ValidateEMail reimplemented via System.Net.Mail.MailAddress internal validator
15+
Bug fixes
16+
* ValidateMobilePhone phone length validation fix
1717
</releaseNotes>
1818
<copyright>Licensed under LGPL</copyright>
1919
<language>en-US</language>

src/Simplify.String/Simplify.String.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
<Product>Simplify</Product>
66
<Description>String operations/validation functions</Description>
77
<Copyright>Licensed under LGPL</Copyright>
8-
<Version>1.2</Version>
8+
<Version>1.2.1</Version>
99
<PackageProjectUrl>https://github.com/SimplifyNet/Simplify</PackageProjectUrl>
1010
<PackageIconUrl>https://raw.githubusercontent.com/SimplifyNet/Images/master/Logo.png</PackageIconUrl>
1111
<RepositoryUrl>https://github.com/SimplifyNet/Simplify/tree/master/src/Simplify.String</RepositoryUrl>
1212
<RepositoryType>GIT</RepositoryType>
1313
<PackageTags>.NET</PackageTags>
1414
<PackageReleaseNotes>
15-
+ .NET Standard 2.0 support
16-
* ValidateEMail reimplemented via System.Net.Mail.MailAddress internal validator
15+
Bug fixes
16+
* ValidateMobilePhone phone length validation fix
1717
</PackageReleaseNotes>
1818
<OutputPath>bin\Any CPU\$(Configuration)\</OutputPath>
1919
<DocumentationFile>bin\Any CPU\$(Configuration)\$(TargetFramework)\Simplify.String.xml</DocumentationFile>

src/Simplify.String/StringHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static bool ValidateMobilePhone(string phone)
5252
if (string.IsNullOrEmpty(phone))
5353
return false;
5454

55-
return Regex.IsMatch(phone, @"^\+[1-9]{1}[0-9]{7,11}$");
55+
return Regex.IsMatch(phone, @"^\+[1-9]{1}[0-9]{4,12}$");
5656
}
5757

5858
/// <summary>

0 commit comments

Comments
 (0)