From 2210b6b8298f8fec5d4a35fbc6404f123c876870 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Mon, 15 May 2023 18:04:05 +0200 Subject: [PATCH] Restrict tel nr length to 15 --- Elwig/Helpers/Validator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Elwig/Helpers/Validator.cs b/Elwig/Helpers/Validator.cs index 52762bc..bc9f3e1 100644 --- a/Elwig/Helpers/Validator.cs +++ b/Elwig/Helpers/Validator.cs @@ -76,7 +76,7 @@ namespace Elwig.Helpers { public static ValidationResult CheckPhoneNumber(TextBox input, bool required) { string text = ""; int pos = input.CaretIndex; - for (int i = 0, v = 0; i < input.Text.Length && v < 30; i++) { + for (int i = 0, v = 0; i < input.Text.Length && v < 15; i++) { char ch = input.Text[i]; if (v == 0 && input.Text.Length - i >= 2 && ch == '0' && input.Text[i + 1] == '0') { v++; i++;