Skip to content

Commit

Permalink
Enhancement: Expose happy path (#406)
Browse files Browse the repository at this point in the history
* Enhancement: Expose happy path

* Fix: Require file with absolute path

* Fix: Return null instead of false
  • Loading branch information
localheinz authored Dec 6, 2023
1 parent 2b70836 commit ede0692
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .router.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit ede0692

Please sign in to comment.