Skip to content

Commit

Permalink
VACMS=15436: added space following file extension to regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Edmund Dunn committed Oct 27, 2023
1 parent b99f980 commit ce54fb3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function validate(Request $req) {
$logger->error("[CC] Alternative text ({$value}) cannot be longer than 150 characters. {$value_length} characters were submitted.");
$res = $this->t('Alternative text cannot be longer than 150 characters.');
}
if (preg_match('/\.(jpg|jpeg|png|gif)$/i', $value)) {
if (preg_match('/\.(jpg|jpeg|png|gif)| $/i', $value)) {
$logger->error("[FN] Alternative text cannot contain file names. {$value} was submitted.");
$res = $this->t('Alternative text cannot contain file names.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public static function validateAltText(array $element, FormStateInterface $formS
$logger->error("[CC] Alternative text ({$value}) cannot be longer than 150 characters. {$value_length} characters were submitted.");
}

if (preg_match('/\.(jpg|jpeg|png|gif)$/i', $value)) {
if (preg_match('/\.(jpg|jpeg|png|gif)| $/i', $value)) {
$formState->setErrorByName(implode('][', $element['#parents']), t('Alternative text cannot contain file names.'));
$logger->error("[FN] Alternative text cannot contain file names. {$value} was submitted.");
}
Expand Down

0 comments on commit ce54fb3

Please sign in to comment.