mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 13:54:26 +02:00
parent
250ae929dd
commit
3035efac65
@ -68,16 +68,16 @@ class StaticController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function imgAction()
|
public function imgAction()
|
||||||
{
|
{
|
||||||
$moduleRoot = Icinga::app()
|
$imgRoot = Icinga::app()
|
||||||
->getModuleManager()
|
->getModuleManager()
|
||||||
->getModule($this->getParam('module_name'))
|
->getModule($this->getParam('module_name'))
|
||||||
->getBaseDir();
|
->getBaseDir() . '/public/img/';
|
||||||
|
|
||||||
$file = $this->getParam('file');
|
$file = $this->getParam('file');
|
||||||
$filePath = realpath($moduleRoot . '/public/img/' . $file);
|
$filePath = realpath($imgRoot . $file);
|
||||||
|
|
||||||
if ($filePath === false) {
|
if ($filePath === false || substr($filePath, 0, strlen($imgRoot)) !== $imgRoot) {
|
||||||
$this->httpNotFound('%s does not exist', $filePath);
|
$this->httpNotFound('%s does not exist', $file);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/\.([a-z]+)$/i', $file, $m)) {
|
if (preg_match('/\.([a-z]+)$/i', $file, $m)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user