Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | protected function ensureFileExistInProject(string $filePath) |
||
11 | { |
||
12 | abort_unless(file_exists($filePath), 404, 'Requested file does not exist.'); |
||
13 | |||
14 | $realPath = realpath($filePath); |
||
15 | |||
16 | $realBasePath = realpath(base_path()); |
||
17 | |||
18 | abort_unless(Str::startsWith($realPath, $realBasePath), 404, 'Requested file was not found in the project.'); |
||
19 | } |
||
20 | |||
32 |