From 01a91bfb4627be2e3660a81bdac391217ec801b6 Mon Sep 17 00:00:00 2001 From: ashubawork <43743394+ashubawork@users.noreply.github.com> Date: Wed, 15 Dec 2021 13:18:41 +0200 Subject: [PATCH] - fixed discord field validation --- includes/core/class-validation.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/core/class-validation.php b/includes/core/class-validation.php index 861c8997..7eb44fb4 100644 --- a/includes/core/class-validation.php +++ b/includes/core/class-validation.php @@ -295,7 +295,10 @@ if ( ! class_exists( 'um\core\Validation' ) ) { if ( ! $string ) { return true; } - if ( ! preg_match( '/(^\S+)#(\d+)$/', trim( $string ) ) ) { + if ( substr_count( $string, '#' ) > 1 ) { + return false; + } + if ( ! preg_match( '/(\S+)#(\d+)$/', trim( $string ) ) ) { return false; } return true;