Merge remote-tracking branch 'origin/support/3.1' into develop

This commit is contained in:
Molkobain
2023-11-23 15:08:22 +01:00

View File

@@ -38,15 +38,17 @@ utils::InitTimeZone();
*/ */
function CheckPageExists(string $sPagePath, array $aPossibleBasePaths) function CheckPageExists(string $sPagePath, array $aPossibleBasePaths)
{ {
$sTargetPage = false;
foreach ($aPossibleBasePaths as $sBasePath) { foreach ($aPossibleBasePaths as $sBasePath) {
$sTargetPage = utils::RealPath($sPagePath, $sBasePath); $sTargetPage = utils::RealPath($sPagePath, $sBasePath);
if ($sTargetPage !== false) { if (
($sTargetPage !== false)
&& (strtolower(pathinfo($sTargetPage, PATHINFO_EXTENSION)) === "php")
) {
return $sTargetPage; return $sTargetPage;
} }
} }
return $sTargetPage; return false;
} }