diff --git a/Sources/Profile.php b/Sources/Profile.php index 55d99e951f..8fc03ae3b3 100644 --- a/Sources/Profile.php +++ b/Sources/Profile.php @@ -2370,6 +2370,7 @@ protected function prepareToSaveCustomFields(?string $area = null): void } elseif ( str_starts_with($cf_def['mask'], 'regex') && trim($value) != '' + && trim(substr($cf_def['mask'], 5)) !== '' && preg_match(substr($cf_def['mask'], 5), $value) === 0 ) { $mask_error = 'custom_field_regex_fail';