Skip to content
This repository was archived by the owner on Jan 1, 2020. It is now read-only.

Commit 117f133

Browse files
bacinskyakrabat
authored andcommitted
Updated public/index.php, exclude cli-server static file requests to self
1 parent 1bc5245 commit 117f133

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

public/index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
chdir(dirname(__DIR__));
77

88
// Decline static file requests back to the PHP built-in webserver
9-
if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) {
9+
$path = __DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
10+
if (php_sapi_name() === 'cli-server' && __FILE__ !== $path && is_file($path)) {
1011
return false;
1112
}
13+
unset($path);
1214

1315
// Setup autoloading
1416
require 'init_autoloader.php';

0 commit comments

Comments
 (0)