mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 05:14:03 +00:00
Prevent 500 error when non-real path is given
This commit is contained in:
parent
f93d075fa5
commit
c1fb86cf34
1 changed files with 1 additions and 1 deletions
|
|
@ -39,7 +39,7 @@ class TenantAssetsController extends Controller
|
||||||
$basePath = storage_path("app/public");
|
$basePath = storage_path("app/public");
|
||||||
$requestPath = realpath($basePath . '/' . $path);
|
$requestPath = realpath($basePath . '/' . $path);
|
||||||
|
|
||||||
$validPath = substr($requestPath, 0, strlen($basePath)) === $basePath;
|
$validPath = $requestPath && substr($requestPath, 0, strlen($basePath)) === $basePath;
|
||||||
abort_if($validPath === false, 404);
|
abort_if($validPath === false, 404);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue