Skip to content

Commit

Permalink
Disable backslash escaping in "is allowed" helper (#169)
Browse files Browse the repository at this point in the history
`allowIn` will fail to match files on Windows without the `FNM_NOESCAPE` flag
  • Loading branch information
spaze committed Feb 6, 2023
2 parents cc97bfb + e0a7806 commit 8ca05ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/IsAllowedFileHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private function absolutizePath(string $path): string
public function matches(Scope $scope, string $allowedPath): bool
{
$file = $scope->getTraitReflection() ? $scope->getTraitReflection()->getFileName() : $scope->getFile();
return $file !== null && fnmatch($this->absolutizePath($allowedPath), $file);
return $file !== null && fnmatch($this->absolutizePath($allowedPath), $file, FNM_NOESCAPE);
}


Expand Down

0 comments on commit 8ca05ab

Please sign in to comment.