From ede0692b3ef68003b09054956f3c282dc8a6b3f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Wed, 6 Dec 2023 19:31:09 +0100 Subject: [PATCH] Enhancement: Expose happy path (#406) * Enhancement: Expose happy path * Fix: Require file with absolute path * Fix: Return null instead of false --- .router.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.router.php b/.router.php index 723801a273..e5bac226f5 100644 --- a/.router.php +++ b/.router.php @@ -3,10 +3,12 @@ $filename = $_SERVER["PATH_INFO"] ?? $_SERVER["SCRIPT_NAME"]; -if (file_exists($_SERVER["DOCUMENT_ROOT"] . $filename)) { - /* This could be an image or whatever, so don't try to compress it */ - ini_set("zlib.output_compression", 0); - return false; +if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $filename)) { + require_once __DIR__ . '/error.php'; + + return; } -include_once "error.php"; +/* This could be an image or whatever, so don't try to compress it */ +ini_set("zlib.output_compression", 0); +return null;