Improving feedback for developer in case media view does not find the specified file

This commit is contained in:
José Lorenzo Rodríguez 2010-10-03 19:00:27 -04:30
parent 0ba5023f3a
commit d117300518

View file

@ -55,7 +55,10 @@ class MediaView extends View {
$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');
}