mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 22:04:25 +02:00
Don't throw exceptions manually in the StaticController
This commit is contained in:
parent
672c679064
commit
7e4c602a60
@ -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];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user