Refactor logoExists function to resolve absolute file paths relative to index.php
This commit is contained in:
parent
6b43788556
commit
f5040c9b64
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user