Don't throw exceptions manually in the StaticController

This commit is contained in:
Eric Lippmann 2015-08-27 14:07:46 +02:00
parent 672c679064
commit 7e4c602a60

View File

@ -5,7 +5,6 @@ use Icinga\Web\Controller;
use Icinga\Application\Icinga; use Icinga\Application\Icinga;
use Icinga\Application\Logger; use Icinga\Application\Logger;
use Icinga\Web\FileCache; use Icinga\Web\FileCache;
use Zend_Controller_Action_Exception as ActionException;
/** /**
* Delivery static content to clients * Delivery static content to clients
@ -64,10 +63,7 @@ class StaticController extends Controller
$filePath = realpath($basedir . '/public/img/' . $file); $filePath = realpath($basedir . '/public/img/' . $file);
if (! $filePath || strpos($filePath, $basedir) !== 0) { if (! $filePath || strpos($filePath, $basedir) !== 0) {
throw new ActionException(sprintf( $this->httpNotFound('%s does not exist', $filePath);
'%s does not exist',
$filePath
), 404);
} }
if (preg_match('/\.([a-z]+)$/i', $file, $m)) { if (preg_match('/\.([a-z]+)$/i', $file, $m)) {
$extension = $m[1]; $extension = $m[1];