From d117300518f419a9ad5228e2244a44009b53185f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Sun, 3 Oct 2010 19:00:27 -0430 Subject: [PATCH] Improving feedback for developer in case media view does not find the specified file --- cake/libs/view/media.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php index ae9653bb9d3..d5de679ba60 100644 --- a/cake/libs/view/media.php +++ b/cake/libs/view/media.php @@ -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'); }