Refactor logoExists function to resolve absolute file paths relative to index.php

This commit is contained in:
Fabian Schieder 2026-02-28 01:25:23 +01:00
parent 6b43788556
commit f5040c9b64

View File

@ -60,7 +60,8 @@ $projects = [
* Verhindert Broken Images. * Verhindert Broken Images.
*/ */
function logoExists(string $webPath): bool { function logoExists(string $webPath): bool {
$filePath = $_SERVER['DOCUMENT_ROOT'] . $webPath; // Absoluten Dateisystempfad relativ zur index.php auflösen
$filePath = __DIR__ . '/' . ltrim($webPath, '/');
return is_file($filePath); return is_file($filePath);
} }