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

Commit 4efd286

Browse files
committed
Only test for path when the SAPI is cli-server
1 parent eba4ea8 commit 4efd286

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

public/index.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
chdir(dirname(__DIR__));
77

88
// Decline static file requests back to the PHP built-in webserver
9-
$path = realpath(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
10-
if (php_sapi_name() === 'cli-server' && __FILE__ !== $path && is_file($path)) {
11-
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);
1215
}
13-
unset($path);
1416

1517
// Setup autoloading
1618
require 'init_autoloader.php';

0 commit comments

Comments
 (0)