Author: Andreas Möller (localheinz)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2023-12-06T18:31:09Z

Commit: 
https://github.com/php/web-php/commit/ede0692b3ef68003b09054956f3c282dc8a6b3f3
Raw diff: 
https://github.com/php/web-php/commit/ede0692b3ef68003b09054956f3c282dc8a6b3f3.diff

Enhancement: Expose happy path (#406)

* Enhancement: Expose happy path

* Fix: Require file with absolute path

* Fix: Return null instead of false

Changed paths:
  M  .router.php


Diff:

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;

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to