mirror of
https://github.com/php/web-php.git
synced 2026-03-23 23:02:13 +01:00
Enhancement: Expose happy path (#406)
* Enhancement: Expose happy path * Fix: Require file with absolute path * Fix: Return null instead of false
This commit is contained in:
12
.router.php
12
.router.php
@@ -3,10 +3,12 @@ $_SERVER["SERVER_ADDR"] = $_SERVER["HTTP_HOST"];
|
||||
|
||||
$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;
|
||||
|
||||
Reference in New Issue
Block a user