From f7964719911d76c5b9f5761d55a2dacdac4be3a3 Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 2 Oct 2024 14:26:30 +0100 Subject: [PATCH] also serve png/ico/svg files raw, if they exist --- tests/router.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/router.php b/tests/router.php index ef3a9f24b..79922403d 100644 --- a/tests/router.php +++ b/tests/router.php @@ -6,7 +6,10 @@ $ha = substr($hash, 0, 2); header("Content-Type: image/jpeg"); print(file_get_contents("data/$silo/$ha/$hash")); -} elseif (preg_match('/.*\.(jpg|jpeg|gif|js|css)/', $_SERVER["REQUEST_URI"])) { +} elseif ( + preg_match('/.*\.(jpg|jpeg|gif|png|ico|svg|js|css)/', $_SERVER["REQUEST_URI"]) + && file_exists($_SERVER["DOCUMENT_ROOT"] . $_SERVER["REQUEST_URI"]) +) { return false; } else { require_once("index.php");