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

Commit 7f276f3

Browse files
committed
Merge branch 'bacinsky-hotfix/index-php-cli-server'
Closes #283
2 parents 1bc5245 + 4efd286 commit 7f276f3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

public/index.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
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))) {
10-
return false;
9+
if (php_sapi_name() === 'cli-server') {
10+
$path = realpath(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
11+
if (__FILE__ !== $path && is_file($path)) {
12+
return false;
13+
}
14+
unset($path);
1115
}
1216

1317
// Setup autoloading

0 commit comments

Comments
 (0)