Skip to content

Commit

Permalink
Check if needle is empty before using strpos.
Browse files Browse the repository at this point in the history
  • Loading branch information
reense committed Aug 26, 2021
1 parent 055d9fc commit 5888eea
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function validate(

foreach ($this->fileDenyList as $file) {
$baseName = pathinfo($actualPath, PATHINFO_BASENAME);
if (stripos($baseName, $file) !== false || preg_match('#' . "\." . $file . '#', $fullPath)) {
if ('' === $needle || false !== strpos($haystack, $needle) || preg_match('#' . "\." . $file . '#', $fullPath)) {
throw new ValidatorException(
new Phrase('"%1" is not a valid file path', [$path])
);
Expand Down

0 comments on commit 5888eea

Please sign in to comment.