1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-04 19:24:02 +00:00

Prevent 500 error when non-real path is given

This commit is contained in:
Craig Riley 2023-06-11 01:53:58 +01:00 committed by GitHub
parent f93d075fa5
commit c1fb86cf34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,7 +39,7 @@ class TenantAssetsController extends Controller
$basePath = storage_path("app/public");
$requestPath = realpath($basePath . '/' . $path);
$validPath = substr($requestPath, 0, strlen($basePath)) === $basePath;
$validPath = $requestPath && substr($requestPath, 0, strlen($basePath)) === $basePath;
abort_if($validPath === false, 404);
try {