Add some safety to $templateUrlPrefix

This commit is contained in:
Willy 2021-09-06 09:15:56 +02:00
parent 780df09b70
commit 06afa86602

View File

@ -4,7 +4,7 @@
// Typically we put this before any local urls, such as navigation, icons etc to ensure that they use the correct path.
$templateUrlPrefix = dirname(str_replace(realpath($_SERVER['DOCUMENT_ROOT']), '', realpath(__DIR__)));
if ((strlen($templateUrlPrefix) > 1)) {
$templateUrlPrefix = $templateUrlPrefix . DIRECTORY_SEPARATOR;
$templateUrlPrefix = htmlspecialchars($templateUrlPrefix . DIRECTORY_SEPARATOR);
}
if ($templateParameters["render"] === false) {