diff --git a/public/index.php b/public/index.php index f3e92f9..6a1165a 100644 --- a/public/index.php +++ b/public/index.php @@ -2,8 +2,8 @@ use App\Kernel; -if (preg_match("/js\/data\.json$/", $_SERVER['REQUEST_URI'])) { - print file_get_contents('js/data.json'); +if (file_exists(__DIR__.$_SERVER['REQUEST_URI']) && is_readable(__DIR__.$_SERVER['REQUEST_URI']) && is_file(__DIR__.$_SERVER['REQUEST_URI'])) { + print file_get_contents(__DIR__.$_SERVER['REQUEST_URI']); exit; }