From 9bc4ddd546cbebe89dba67b0a354c3ce1f255aea Mon Sep 17 00:00:00 2001 From: Alex Sokol Date: Sat, 18 Feb 2023 00:43:50 +0300 Subject: [PATCH] Fixed regular expression for int Previous regular expression allowed numbers like "-1-1-4" and would throw exceptions during runtime. --- .../src/main/java/org/telegram/messenger/Utilities.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java index 5e3dfb73d..f129fa5d9 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java @@ -28,7 +28,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; public class Utilities { - public static Pattern pattern = Pattern.compile("[\\-0-9]+"); + public static Pattern pattern = Pattern.compile("-?[0-9]+"); public static SecureRandom random = new SecureRandom(); public static Random fastRandom = new Xoroshiro128PlusRandom(random.nextLong());