diff --git a/bin/gpm b/bin/gpm index a2eebc68c..ba2fad110 100755 --- a/bin/gpm +++ b/bin/gpm @@ -25,10 +25,6 @@ if (!file_exists(__DIR__ . '/../vendor/autoload.php')){ $autoload = require __DIR__ . '/../vendor/autoload.php'; -if (version_compare($ver = PHP_VERSION, $req = GRAV_PHP_MIN, '<')) { - exit(sprintf("You are running PHP %s, but Grav needs at least PHP %s to run.\n", $ver, $req)); -} - if (!ini_get('date.timezone')) { date_default_timezone_set('UTC'); } diff --git a/bin/grav b/bin/grav index f3f77efe8..4d0e80c8d 100755 --- a/bin/grav +++ b/bin/grav @@ -25,10 +25,6 @@ if (!file_exists(__DIR__ . '/../vendor/autoload.php')){ $autoload = require __DIR__ . '/../vendor/autoload.php'; -if (version_compare($ver = PHP_VERSION, $req = GRAV_PHP_MIN, '<')) { - exit(sprintf("You are running PHP %s, but Grav needs at least PHP %s to run.\n", $ver, $req)); -} - if (!ini_get('date.timezone')) { date_default_timezone_set('UTC'); } diff --git a/bin/plugin b/bin/plugin index b401c0357..0f2a64720 100755 --- a/bin/plugin +++ b/bin/plugin @@ -25,10 +25,6 @@ if (!file_exists(__DIR__ . '/../vendor/autoload.php')){ $autoload = require __DIR__ . '/../vendor/autoload.php'; -if (version_compare($ver = PHP_VERSION, $req = GRAV_PHP_MIN, '<')) { - exit(sprintf("You are running PHP %s, but Grav needs at least PHP %s to run.\n", $ver, $req)); -} - if (!ini_get('date.timezone')) { date_default_timezone_set('UTC'); } diff --git a/index.php b/index.php index 091e9a824..66e2deeb9 100644 --- a/index.php +++ b/index.php @@ -12,10 +12,6 @@ namespace Grav; \define('GRAV_REQUEST_TIME', microtime(true)); \define('GRAV_PHP_MIN', '7.3.6'); -if (version_compare($ver = PHP_VERSION, $req = GRAV_PHP_MIN, '<')) { - die(sprintf('You are running PHP %s, but Grav needs at least PHP %s to run.', $ver, $req)); -} - if (PHP_SAPI === 'cli-server') { $symfony_server = stripos(getenv('_'), 'symfony') !== false || stripos($_SERVER['SERVER_SOFTWARE'] ?? '', 'symfony') !== false || stripos($_ENV['SERVER_SOFTWARE'] ?? '', 'symfony') !== false; diff --git a/system/router.php b/system/router.php index d58609c83..b43ea5d38 100644 --- a/system/router.php +++ b/system/router.php @@ -22,9 +22,9 @@ if ($path !== '/index.php' && is_file($root . $path)) { // Block all direct access for these folders || preg_match('`^/(\.git|cache|bin|logs|backup|webserver-configs|tests)/`ui', $path) // Block access to specific file types for these system folders - || preg_match('`^/(system|vendor)/(.*)\.(txt|xml|md|html|yaml|yml|php|pl|py|cgi|twig|sh|bat)$`ui', $path) + || preg_match('`^/(system|vendor)/(.*)\.(txt|xml|md|html|json|yaml|yml|php|pl|py|cgi|twig|sh|bat)$`ui', $path) // Block access to specific file types for these user folders - || preg_match('`^/(user)/(.*)\.(txt|md|yaml|yml|php|pl|py|cgi|twig|sh|bat)$`ui', $path) + || preg_match('`^/(user)/(.*)\.(txt|md|json|yaml|yml|php|pl|py|cgi|twig|sh|bat)$`ui', $path) // Block all direct access to .md files || preg_match('`\.md$`ui', $path) // Block access to specific files in the root folder diff --git a/tests/phpstan/plugins-bootstrap.php b/tests/phpstan/plugins-bootstrap.php index c28f2ab8a..1c1828033 100644 --- a/tests/phpstan/plugins-bootstrap.php +++ b/tests/phpstan/plugins-bootstrap.php @@ -10,10 +10,6 @@ use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator; $autoload = require __DIR__ . '/../../vendor/autoload.php'; -if (version_compare($ver = PHP_VERSION, $req = GRAV_PHP_MIN, '<')) { - exit(sprintf("You are running PHP %s, but Grav needs at least PHP %s to run.\n", $ver, $req)); -} - if (!ini_get('date.timezone')) { date_default_timezone_set('UTC'); }