Skip to content

Commit 5c0e5bc

Browse files
authored
Update Checker.php
fixed PHP warning `preg_match(): Compilation failed: invalid range in character class`
1 parent 4f12fdc commit 5c0e5bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ImageAccessibility/Checker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private function _eval_imgs(array $img_nodes): void
8585
'recommendation' => 'If this image is integral to the content, please add a description.'];
8686
}
8787
// modified regex from https://stackoverflow.com/questions/6768779/test-filename-with-regular-expression
88-
if (preg_match("/^[\w,\s-\.]+\.[A-Za-z]{3,}$/", trim($alt))) {
88+
if (preg_match("/^[\w,\s\-\.]+\.[A-Za-z]{3,}$/", trim($alt))) {
8989
$this->errors[] = (object) [
9090
'type' => 'filename alt',
9191
'src' => $src,

0 commit comments

Comments
 (0)