A free, self-hostable news aggregator…
Move PHP minimum version check (#7560)
Alexandre Alapetite3f187395eaed
diff --git a/constants.php b/constants.phpindex 2b4f563c9..8e9d76160 100644--- a/constants.php+++ b/constants.php@@ -35,6 +35,10 @@ const CORE_EXTENSIONS_PATH = LIB_PATH . '/core-extensions';const TESTS_PATH = FRESHRSS_PATH . '/tests';//</Not customisable>+if (version_compare(PHP_VERSION, FRESHRSS_MIN_PHP_VERSION, '<')) {+ die(sprintf('Error: FreshRSS requires PHP %s+ but was invoked with PHP %s!', FRESHRSS_MIN_PHP_VERSION, PHP_VERSION));+}+if (file_exists(__DIR__ . '/constants.local.php')) {//Include custom / local settings:include(__DIR__ . '/constants.local.php');diff --git a/lib/lib_rss.php b/lib/lib_rss.phpindex e1618a2ef..3ddda1515 100644--- a/lib/lib_rss.php+++ b/lib/lib_rss.php@@ -1,10 +1,6 @@<?phpdeclare(strict_types=1);-if (version_compare(PHP_VERSION, FRESHRSS_MIN_PHP_VERSION, '<')) {- die(sprintf('FreshRSS error: FreshRSS requires PHP %s+!', FRESHRSS_MIN_PHP_VERSION));-}-if (!function_exists('mb_strcut')) {function mb_strcut(string $str, int $start, ?int $length = null, string $encoding = 'UTF-8'): string {return substr($str, $start, $length) ?: '';