From c2c5c20c319d397948218b4c342fb146bf15040b Mon Sep 17 00:00:00 2001 From: javiexin Date: Fri, 12 May 2017 23:04:54 +0200 Subject: [PATCH] [ticket/15227] Check PHP version and remove old unused code PHPBB3-15227 --- phpBB/common.php | 5 ----- phpBB/includes/startup.php | 31 ++++++++++--------------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/phpBB/common.php b/phpBB/common.php index 70feb55d04..172503f078 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -20,11 +20,6 @@ if (!defined('IN_PHPBB')) exit; } -if (version_compare(PHP_VERSION, '5.4') < 0) -{ - die('You are running an unsupported PHP version. Please upgrade to PHP 5.4.0 or higher before trying to install or update to phpBB 3.2'); -} - require($phpbb_root_path . 'includes/startup.' . $phpEx); require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx); diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php index 5900016c39..327971fa8a 100644 --- a/phpBB/includes/startup.php +++ b/phpBB/includes/startup.php @@ -80,30 +80,19 @@ function deregister_globals() unset($input); } -// Register globals and magic quotes have been dropped in PHP 5.4 -if (version_compare(PHP_VERSION, '5.4.0-dev', '>=')) +/** +* Minimum Requirement: PHP 5.4.0 +*/ +if (version_compare(PHP_VERSION, '5.4') < 0) { - /** - * @ignore - */ - define('STRIP', false); + die('You are running an unsupported PHP version. Please upgrade to PHP 5.4.0 or higher before trying to install or update to phpBB 3.2'); } -else -{ - if (get_magic_quotes_runtime()) - { - // Deactivate - @set_magic_quotes_runtime(0); - } - // Be paranoid with passed vars - if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on' || !function_exists('ini_get')) - { - deregister_globals(); - } - - define('STRIP', (get_magic_quotes_gpc()) ? true : false); -} +// Register globals and magic quotes have been dropped in PHP 5.4 so no need for extra checks +/** +* @ignore +*/ +define('STRIP', false); // In PHP 5.3.0 the error level has been raised to E_WARNING which causes problems // because we show E_WARNING errors and do not set a default timezone.