Remove support for magic_quotes_gpc
[lhc/web/wiklou.git] / includes / installer / Installer.php
index cdc8266..0294c42 100644 (file)
@@ -119,7 +119,6 @@ abstract class Installer {
                'envCheckRegisterGlobals',
                'envCheckBrokenXML',
                'envCheckMagicQuotes',
-               'envCheckMagicSybase',
                'envCheckMbstring',
                'envCheckSafeMode',
                'envCheckXML',
@@ -219,6 +218,7 @@ abstract class Installer {
                '_LicenseCode' => 'none',
                '_CCDone' => false,
                '_Extensions' => array(),
+               '_Skins' => array(),
                '_MemCachedServers' => '',
                '_UpgradeKeySupplied' => false,
                '_ExistingDBSettings' => false,
@@ -761,31 +761,19 @@ abstract class Installer {
        }
 
        /**
-        * Environment check for magic_quotes_runtime.
+        * Environment check for magic_quotes_(gpc|runtime|sybase).
         * @return bool
         */
        protected function envCheckMagicQuotes() {
-               if ( wfIniGetBool( "magic_quotes_runtime" ) ) {
-                       $this->showError( 'config-magic-quotes-runtime' );
-
-                       return false;
-               }
-
-               return true;
-       }
-
-       /**
-        * Environment check for magic_quotes_sybase.
-        * @return bool
-        */
-       protected function envCheckMagicSybase() {
-               if ( wfIniGetBool( 'magic_quotes_sybase' ) ) {
-                       $this->showError( 'config-magic-quotes-sybase' );
-
-                       return false;
+               $status = true;
+               foreach ( array( 'gpc', 'runtime', 'sybase' ) as $magicJunk ) {
+                       if ( wfIniGetBool( "magic_quotes_$magicJunk" ) ) {
+                               $this->showError( "config-magic-quotes-$magicJunk" );
+                               $status = false;
+                       }
                }
 
-               return true;
+               return $status;
        }
 
        /**
@@ -1440,17 +1428,20 @@ abstract class Installer {
        }
 
        /**
-        * Finds extensions that follow the format /extensions/Name/Name.php,
+        * Finds extensions that follow the format /$directory/Name/Name.php,
         * and returns an array containing the value for 'Name' for each found extension.
         *
+        * Reasonable values for $directory include 'extensions' (the default) and 'skins'.
+        *
+        * @param string $directory Directory to search in
         * @return array
         */
-       public function findExtensions() {
+       public function findExtensions( $directory = 'extensions' ) {
                if ( $this->getVar( 'IP' ) === null ) {
                        return array();
                }
 
-               $extDir = $this->getVar( 'IP' ) . '/extensions';
+               $extDir = $this->getVar( 'IP' ) . '/' . $directory;
                if ( !is_readable( $extDir ) || !is_dir( $extDir ) ) {
                        return array();
                }