Skip to content

Commit

Permalink
Improve matches check
Browse files Browse the repository at this point in the history
  • Loading branch information
markusweigelt committed Jan 22, 2025
1 parent 7acad31 commit b3bdb62
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Classes/Validation/DomDocumentUrlExistenceValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ protected function getDocumentUrls(DOMDocument $document): array

// get the urls of document without file group nodes
preg_match_all('/' . ValidationHelper::URL_REGEX . '/i', $tempDocument->saveXML(), $matches);
$urls += $matches[0] ?? [];
if (is_array($matches) && count($matches) > 0) {
$urls += $matches[0];
}
return array_unique($urls);
}

Expand Down

0 comments on commit b3bdb62

Please sign in to comment.