From cb9190a1f2a75543d5fea4fa660c3ec7634896a7 Mon Sep 17 00:00:00 2001 From: colemanw Date: Wed, 7 Jun 2023 09:02:47 -0400 Subject: [PATCH] UtilsRule - Don't check empty values when validating email --- CRM/Utils/Rule.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CRM/Utils/Rule.php b/CRM/Utils/Rule.php index 28c563817a..df620d1637 100644 --- a/CRM/Utils/Rule.php +++ b/CRM/Utils/Rule.php @@ -658,6 +658,10 @@ class CRM_Utils_Rule { * @return bool */ public static function email($value): bool { + if ($value === '' || is_null($value)) { + // Nothing to check + return TRUE; + } if (function_exists('idn_to_ascii')) { $parts = explode('@', $value); foreach ($parts as &$part) { -- 2.25.1