Remove register_globals and magic_quotes_* checks
authorMax Semenik <maxsem.wiki@gmail.com>
Thu, 11 Feb 2016 00:41:44 +0000 (16:41 -0800)
committerMax Semenik <maxsem.wiki@gmail.com>
Thu, 11 Feb 2016 19:11:49 +0000 (11:11 -0800)
Yay, this crap is finally gone as of PHP 5.4!

Change-Id: I2cb01b5bf0fdde4c8cf5286ef6aff93ac45e99fd

includes/WebStart.php
includes/installer/Installer.php
includes/installer/i18n/en.json
includes/installer/i18n/qqq.json

index fb6c3e6..9ee8042 100644 (file)
  * @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 '
-               . '<a href="https://www.mediawiki.org/wiki/register_globals">mediawiki.org</a> '
-               . '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 '
-               . '<a href="https://php.net/manual/security.magicquotes.disabling.php">PHP Manual</a> '
-               . '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
index 40e51f0..0ef2d47 100644 (file)
@@ -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
index 8d2040d..c6f3e1d 100644 (file)
        "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 <code>./configure --with-mysqli</code>.\nIf you installed PHP from a Debian or Ubuntu package, then you also need to install, for example, the <code>php5-mysql</code> package.",
        "config-outdated-sqlite": "<strong>Warning:</strong> you have SQLite $1, which is lower than minimum required version $2. SQLite will be unavailable.",
        "config-no-fts3": "<strong>Warning:</strong> SQLite is compiled without the [//sqlite.org/fts3.html FTS3 module], search features will be unavailable on this backend.",
-       "config-register-globals-error": "<strong>Error: PHP's <code>[http://php.net/register_globals register_globals]</code> option is enabled.\nIt must be disabled to continue with the installation.</strong>\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": "<strong>Fatal: [http://www.php.net/manual/en/ref.info.php#ini.magic-quotes-gpc magic_quotes_gpc] is active!</strong>\nThis option corrupts data input unpredictably.\nYou cannot install or use MediaWiki unless this option is disabled.",
-       "config-magic-quotes-runtime": "<strong>Fatal: [http://www.php.net/manual/en/ref.info.php#ini.magic-quotes-runtime magic_quotes_runtime] is active!'</strong>\nThis option corrupts data input unpredictably.\nYou cannot install or use MediaWiki unless this option is disabled.",
-       "config-magic-quotes-sybase": "<strong>Fatal: [http://www.php.net/manual/en/ref.info.php#ini.magic-quotes-sybase magic_quotes_sybase] is active!</strong>\nThis option corrupts data input unpredictably.\nYou cannot install or use MediaWiki unless this option is disabled.",
        "config-mbstring": "<strong>Fatal: [http://www.php.net/manual/en/ref.mbstring.php#mbstring.overload mbstring.func_overload] is active!</strong>\nThis option causes errors and may corrupt data unpredictably.\nYou cannot install or use MediaWiki unless this option is disabled.",
        "config-safe-mode": "<strong>Warning:</strong> PHP's [http://www.php.net/features.safe-mode safe mode] is active.\nIt may cause problems, particularly if using file uploads and <code>math</code> 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.",
index 372b228..80d5e3e 100644 (file)
        "config-no-db": "{{doc-important|Do not translate \"<code>./configure --with-mysqli</code>\" and \"<code>php5-mysql</code>\".}}\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.",