From 1d049a7451aa9202adc65eb10d74820c6b0a80bc Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Wed, 22 Jan 2014 17:23:09 -0500 Subject: [PATCH] Installer: Remove two environmental checks * envCheckPHP531: Message is outdated ("downgrade to 5.3.0"; the current minimum PHP version is 5.3.2), and PHP Bug #50394 has not reappeared in any later version. * envCheckZE1: zend.ze1_compatibility_mode was removed in 5.3.0. Also updated the error message for envCheckBrokenXML to remove the "Upgrade to PHP 5.2.9 or later" wording. Change-Id: Ifc8754151dd23a0314c6739cb78c7ac61a306bc4 --- includes/AutoLoader.php | 1 - includes/installer/Installer.i18n.php | 10 ++------ includes/installer/Installer.php | 33 --------------------------- includes/installer/PhpBugTests.php | 26 --------------------- maintenance/update.php | 18 +++------------ 5 files changed, 5 insertions(+), 83 deletions(-) diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index a7ac139c2a..6d65a82671 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -609,7 +609,6 @@ $wgAutoloadLocalClasses = array( 'MysqlUpdater' => 'includes/installer/MysqlUpdater.php', 'OracleInstaller' => 'includes/installer/OracleInstaller.php', 'OracleUpdater' => 'includes/installer/OracleUpdater.php', - 'PhpRefCallBugTester' => 'includes/installer/PhpBugTests.php', 'PhpXmlBugTester' => 'includes/installer/PhpBugTests.php', 'PostgresInstaller' => 'includes/installer/PostgresInstaller.php', 'PostgresUpdater' => 'includes/installer/PostgresUpdater.php', diff --git a/includes/installer/Installer.i18n.php b/includes/installer/Installer.i18n.php index cbd9af255a..69fd6a3fc8 100644 --- a/includes/installer/Installer.i18n.php +++ b/includes/installer/Installer.i18n.php @@ -115,9 +115,6 @@ This option corrupts data input unpredictably. You cannot install or use MediaWiki unless this option is disabled.", 'config-mbstring' => "'''Fatal: [http://www.php.net/manual/en/ref.mbstring.php#mbstring.overload mbstring.func_overload] is active!''' This option causes errors and may corrupt data unpredictably. -You cannot install or use MediaWiki unless this option is disabled.", - 'config-ze1' => "'''Fatal: [http://www.php.net/manual/en/ini.core.php zend.ze1_compatibility_mode] is active!''' -This option causes horrible bugs with MediaWiki. You cannot install or use MediaWiki unless this option is disabled.", 'config-safe-mode' => "'''Warning:''' PHP's [http://www.php.net/features.safe-mode safe mode] is active. It may cause problems, particularly if using file uploads and math support.", @@ -163,11 +160,8 @@ Installation aborted.", Although MediaWiki checks all uploaded files for security threats, it is highly recommended to [//www.mediawiki.org/wiki/Manual:Security#Upload_security close this security vulnerability] before enabling uploads.", 'config-no-cli-uploads-check' => "'''Warning:''' Your default directory for uploads ($1) is not checked for vulnerability to arbitrary script execution during the CLI install.", - 'config-brokenlibxml' => 'Your system has a combination of PHP and libxml2 versions which is buggy and can cause hidden data corruption in MediaWiki and other web applications. -Upgrade to PHP 5.2.9 or later and libxml2 2.7.3 or later ([//bugs.php.net/bug.php?id=45996 bug filed with PHP]). -Installation aborted.', - 'config-using531' => 'MediaWiki cannot be used with PHP $1 due to a bug involving reference parameters to __call(). -Upgrade to PHP 5.3.2 or higher, or downgrade to PHP 5.3.0 to resolve this. + 'config-brokenlibxml' => 'Your system has a combination of PHP and libxml2 versions that is buggy and can cause hidden data corruption in MediaWiki and other web applications. +Upgrade to libxml2 2.7.3 or later ([https://bugs.php.net/bug.php?id=45996 bug filed with PHP]). Installation aborted.', 'config-suhosin-max-value-length' => "Suhosin is installed and limits the GET parameter length to $1 bytes. MediaWiki's ResourceLoader component will work around this limit, but that will degrade performance. diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 9fbf0881f6..8b15f0cc29 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -116,11 +116,9 @@ abstract class Installer { 'envCheckDB', 'envCheckRegisterGlobals', 'envCheckBrokenXML', - 'envCheckPHP531', 'envCheckMagicQuotes', 'envCheckMagicSybase', 'envCheckMbstring', - 'envCheckZE1', 'envCheckSafeMode', 'envCheckXML', 'envCheckPCRE', @@ -734,23 +732,6 @@ abstract class Installer { return true; } - /** - * Test PHP (probably 5.3.1, but it could regress again) to make sure that - * reference parameters to __call() are not converted to null - * @return bool - */ - protected function envCheckPHP531() { - $test = new PhpRefCallBugTester; - $test->execute(); - if ( !$test->ok ) { - $this->showError( 'config-using531', phpversion() ); - - return false; - } - - return true; - } - /** * Environment check for magic_quotes_runtime. * @return bool @@ -793,20 +774,6 @@ abstract class Installer { return true; } - /** - * Environment check for zend.ze1_compatibility_mode. - * @return bool - */ - protected function envCheckZE1() { - if ( wfIniGetBool( 'zend.ze1_compatibility_mode' ) ) { - $this->showError( 'config-ze1' ); - - return false; - } - - return true; - } - /** * Environment check for safe_mode. * @return bool diff --git a/includes/installer/PhpBugTests.php b/includes/installer/PhpBugTests.php index 5471264468..0460134a7f 100644 --- a/includes/installer/PhpBugTests.php +++ b/includes/installer/PhpBugTests.php @@ -45,29 +45,3 @@ class PhpXmlBugTester { $this->parsedData .= $data; } } - -/** - * Test for PHP bug #50394 (PHP 5.3.x conversion to null only, not 5.2.x) - * @see http://bugs.php.net/bug.php?id=50394 - * @ingroup PHPBugTests - */ -class PhpRefCallBugTester { - public $ok = false; - - function __call( $name, $args ) { - $old = error_reporting( E_ALL & ~E_WARNING ); - call_user_func_array( array( $this, 'checkForBrokenRef' ), $args ); - error_reporting( $old ); - } - - function checkForBrokenRef( &$var ) { - if ( $var ) { - $this->ok = true; - } - } - - function execute() { - $var = true; - call_user_func_array( array( $this, 'foo' ), array( &$var ) ); - } -} diff --git a/maintenance/update.php b/maintenance/update.php index ea3133ca72..85364ee3a3 100644 --- a/maintenance/update.php +++ b/maintenance/update.php @@ -74,22 +74,10 @@ class UpdateMediaWiki extends Maintenance { $test = new PhpXmlBugTester(); if ( !$test->ok ) { $this->error( - "Your system has a combination of PHP and libxml2 versions which is buggy\n" . + "Your system has a combination of PHP and libxml2 versions that is buggy\n" . "and can cause hidden data corruption in MediaWiki and other web apps.\n" . - "Upgrade to PHP 5.2.9 or later and libxml2 2.7.3 or later!\n" . - "ABORTING (see http://bugs.php.net/bug.php?id=45996).\n", - true ); - } - - $test = new PhpRefCallBugTester; - $test->execute(); - if ( !$test->ok ) { - $ver = phpversion(); - $this->error( - "PHP $ver is not compatible with MediaWiki due to a bug involving\n" . - "reference parameters to __call. Upgrade to PHP 5.3.2 or higher, or \n" . - "downgrade to PHP 5.3.0 to fix this.\n" . - "ABORTING (see http://bugs.php.net/bug.php?id=50394 for details)\n", + "Upgrade to libxml2 2.7.3 or later.\n" . + "ABORTING (see https://bugs.php.net/bug.php?id=45996).\n", true ); } } -- 2.20.1