From 0318eba4975e806481b66dfd6cfa253171545e8a Mon Sep 17 00:00:00 2001 From: Fabian Schieder Date: Sat, 28 Feb 2026 01:29:03 +0100 Subject: [PATCH] Refactor logoExists function to use document root for file path resolution --- index.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index 17a64e8..5b7b5ef 100644 --- a/index.php +++ b/index.php @@ -60,9 +60,10 @@ $projects = [ * Verhindert Broken Images. */ function logoExists(string $webPath): bool { - // Absoluten Dateisystempfad relativ zur index.php auflösen - $filePath = __DIR__ . '/' . ltrim($webPath, '/'); - return is_file($filePath); + $base = rtrim($_SERVER['DOCUMENT_ROOT'] ?? '/var/www/fabianschieder.com', '/'); + $full = $base . '/' . ltrim($webPath, '/'); + // Debug: echo "\n"; + return is_file($full); } ?> @@ -114,7 +115,7 @@ function logoExists(string $webPath): bool { >
- +