mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Improving feedback for developer in case media view does not find the specified file
This commit is contained in:
parent
0ba5023f3a
commit
d117300518
1 changed files with 4 additions and 1 deletions
|
@ -55,7 +55,10 @@ class MediaView extends View {
|
||||||
$path = APP . $path . $id;
|
$path = APP . $path . $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file_exists($path)) {
|
if (!is_file($path)) {
|
||||||
|
if (Configure::read('debug')) {
|
||||||
|
throw new NotFoundException(sprintf('The requested file %s was not found', $path));
|
||||||
|
}
|
||||||
throw new NotFoundException('The requested file was not found');
|
throw new NotFoundException('The requested file was not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue