Skip to content

Commit

Permalink
use str_starts_with (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuernbergerA authored Apr 6, 2021
1 parent e818c7a commit 08537a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Swoole/SwooleClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected function fileIsServable(string $publicPath, string $pathToFile): bool
{
return $pathToFile &&
! in_array(pathinfo($pathToFile, PATHINFO_EXTENSION), ['php', 'htaccess', 'config']) &&
substr($pathToFile, 0, strlen($publicPath)) === $publicPath &&
str_starts_with($pathToFile, $publicPath) &&
is_file($pathToFile) && filesize($pathToFile);
}

Expand Down

0 comments on commit 08537a7

Please sign in to comment.