doc: Make sure to correctly access images

This commit is contained in:
Johannes Meyer 2020-11-09 11:40:12 +01:00
parent 7abb62976a
commit 90e23ebaf3
1 changed files with 1 additions and 1 deletions

View File

@ -139,7 +139,7 @@ class ModuleController extends DocController
$image = $this->params->getRequired('image');
$docPath = $this->getPath($module, Icinga::app()->getModuleManager()->getModuleDir($module, '/doc'));
$imagePath = realpath($docPath . '/' . $image);
if ($imagePath === false) {
if ($imagePath === false || substr($imagePath, 0, strlen($docPath)) !== $docPath) {
$this->httpNotFound('%s does not exist', $image);
}