From 231d152d63f4a12e4e40da210b059a8c1ab5a1d9 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Wed, 10 Feb 2016 16:41:44 -0800 Subject: [PATCH] Remove register_globals and magic_quotes_* checks Yay, this crap is finally gone as of PHP 5.4! Change-Id: I2cb01b5bf0fdde4c8cf5286ef6aff93ac45e99fd --- includes/WebStart.php | 13 ------------- includes/installer/Installer.php | 32 -------------------------------- includes/installer/i18n/en.json | 4 ---- includes/installer/i18n/qqq.json | 4 ---- 4 files changed, 53 deletions(-) diff --git a/includes/WebStart.php b/includes/WebStart.php index fb6c3e6768..9ee8042d54 100644 --- a/includes/WebStart.php +++ b/includes/WebStart.php @@ -26,19 +26,6 @@ * @file */ -# Die if register_globals is enabled (PHP <=5.3) -# This must be done before any globals are set by the code -if ( ini_get( 'register_globals' ) ) { - die( 'MediaWiki does not support installations where register_globals is enabled. Please see ' - . 'mediawiki.org ' - . 'for help on how to disable it.' ); -} - -if ( function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc() ) { - die( 'MediaWiki does not function when magic quotes are enabled. Please see the ' - . 'PHP Manual ' - . 'for help on how to disable magic quotes.' ); -} # bug 15461: Make IE8 turn off content sniffing. Everybody else should ignore this # We're adding it here so that it's *always* set, even for alternate entry diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 40e51f0b41..0ef2d47790 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -116,9 +116,7 @@ abstract class Installer { */ protected $envChecks = array( 'envCheckDB', - 'envCheckRegisterGlobals', 'envCheckBrokenXML', - 'envCheckMagicQuotes', 'envCheckMbstring', 'envCheckSafeMode', 'envCheckXML', @@ -736,20 +734,6 @@ abstract class Installer { return true; } - /** - * Environment check for register_globals. - * Prevent installation if enabled - * @return bool - */ - protected function envCheckRegisterGlobals() { - if ( wfIniGetBool( 'register_globals' ) ) { - $this->showMessage( 'config-register-globals-error' ); - return false; - } - - return true; - } - /** * Some versions of libxml+PHP break < and > encoding horribly * @return bool @@ -765,22 +749,6 @@ abstract class Installer { return true; } - /** - * Environment check for magic_quotes_(gpc|runtime|sybase). - * @return bool - */ - protected function envCheckMagicQuotes() { - $status = true; - foreach ( array( 'gpc', 'runtime', 'sybase' ) as $magicJunk ) { - if ( wfIniGetBool( "magic_quotes_$magicJunk" ) ) { - $this->showError( "config-magic-quotes-$magicJunk" ); - $status = false; - } - } - - return $status; - } - /** * Environment check for mbstring.func_overload. * @return bool diff --git a/includes/installer/i18n/en.json b/includes/installer/i18n/en.json index 8d2040d043..c6f3e1df7f 100644 --- a/includes/installer/i18n/en.json +++ b/includes/installer/i18n/en.json @@ -51,10 +51,6 @@ "config-no-db": "Could not find a suitable database driver! You need to install a database driver for PHP.\nThe following database {{PLURAL:$2|type is|types are}} supported: $1.\n\nIf you compiled PHP yourself, reconfigure it with a database client enabled, for example, using ./configure --with-mysqli.\nIf you installed PHP from a Debian or Ubuntu package, then you also need to install, for example, the php5-mysql package.", "config-outdated-sqlite": "Warning: you have SQLite $1, which is lower than minimum required version $2. SQLite will be unavailable.", "config-no-fts3": "Warning: SQLite is compiled without the [//sqlite.org/fts3.html FTS3 module], search features will be unavailable on this backend.", - "config-register-globals-error": "Error: PHP's [http://php.net/register_globals register_globals] option is enabled.\nIt must be disabled to continue with the installation.\nSee [https://www.mediawiki.org/wiki/register_globals https://www.mediawiki.org/wiki/register_globals] for help on how to do so.", - "config-magic-quotes-gpc": "Fatal: [http://www.php.net/manual/en/ref.info.php#ini.magic-quotes-gpc magic_quotes_gpc] is active!\nThis option corrupts data input unpredictably.\nYou cannot install or use MediaWiki unless this option is disabled.", - "config-magic-quotes-runtime": "Fatal: [http://www.php.net/manual/en/ref.info.php#ini.magic-quotes-runtime magic_quotes_runtime] is active!'\nThis option corrupts data input unpredictably.\nYou cannot install or use MediaWiki unless this option is disabled.", - "config-magic-quotes-sybase": "Fatal: [http://www.php.net/manual/en/ref.info.php#ini.magic-quotes-sybase magic_quotes_sybase] is active!\nThis option corrupts data input unpredictably.\nYou 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!\nThis option causes errors and may corrupt data unpredictably.\nYou 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.\nIt may cause problems, particularly if using file uploads and math support.", "config-xml-bad": "PHP's XML module is missing.\nMediaWiki requires functions in this module and will not work in this configuration.\nYou may need to install the php-xml RPM package.", diff --git a/includes/installer/i18n/qqq.json b/includes/installer/i18n/qqq.json index 372b228fa2..80d5e3e844 100644 --- a/includes/installer/i18n/qqq.json +++ b/includes/installer/i18n/qqq.json @@ -69,10 +69,6 @@ "config-no-db": "{{doc-important|Do not translate \"./configure --with-mysqli\" and \"php5-mysql\".}}\nParameters:\n* $1 is comma separated list of database types supported by MediaWiki.\n* $2 is the count of items in $1 - for use in plural.", "config-outdated-sqlite": "Used as warning. Parameters:\n* $1 - the version of SQLite that has been installed\n* $2 - minimum version", "config-no-fts3": "A \"[[:wikipedia:Front and back ends|backend]]\" is a system or component that ordinary users don't interact with directly and don't need to know about, and that is responsible for a distinct task or service - for example, a storage back-end is a generic system for storing data which other applications can use. Possible alternatives for back-end are \"system\" or \"service\", or (depending on context and language) even leave it untranslated.", - "config-register-globals-error": "Error message in the MediaWiki installer environment checks.", - "config-magic-quotes-gpc": "{{Related|Config-fatal}}", - "config-magic-quotes-runtime": "{{Related|Config-fatal}}", - "config-magic-quotes-sybase": "{{Related|Config-fatal}}", "config-mbstring": "{{Related|Config-fatal}}", "config-safe-mode": "Status message in the MediaWiki installer environment checks.", "config-xml-bad": "Status message in the MediaWiki installer environment checks.", -- 2.20.1