Skip to content

Commit

Permalink
Improving feedback for developer in case media view does not find the…
Browse files Browse the repository at this point in the history
… specified file
  • Loading branch information
lorenzo committed Oct 3, 2010
1 parent 0ba5023 commit d117300
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cake/libs/view/media.php
Expand Up @@ -55,7 +55,10 @@ function render() {
$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');

This comment has been minimized.

Copy link
@markstory

markstory Oct 9, 2010

Member

Couldn't you make the message the conditional part and only have the one throw?

This comment has been minimized.

Copy link
@lorenzo

lorenzo Oct 9, 2010

Author Member

Good idea :)

}

Expand Down

0 comments on commit d117300

Please sign in to comment.