Merge "Installer: Remove wgResourceLoaderMaxQueryLength in LocalSettings"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 4 Jul 2013 15:24:58 +0000 (15:24 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 4 Jul 2013 15:24:58 +0000 (15:24 +0000)
includes/DefaultSettings.php
includes/Setup.php
includes/installer/Installer.php
includes/installer/LocalSettingsGenerator.php

index 10f2885..f9d280f 100644 (file)
@@ -3019,8 +3019,10 @@ $wgLegacyJavaScriptGlobals = true;
  *
  * If set to a negative number, ResourceLoader will assume there is no query
  * string length limit.
+ *
+ * Defaults to a value based on php configuration.
  */
-$wgResourceLoaderMaxQueryLength = -1;
+$wgResourceLoaderMaxQueryLength = false;
 
 /**
  * If set to true, JavaScript modules loaded from wiki pages will be parsed
index d8c9180..028758f 100644 (file)
@@ -293,6 +293,13 @@ if ( $wgMetaNamespace === false ) {
        $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
 }
 
+
+// Default value is either the suhosin limit or -1 for unlimited
+if ( $wgResourceLoaderMaxQueryLength === false ) {
+       $maxValueLength = ini_get( 'suhosin.get.max_value_length' );
+       $wgResourceLoaderMaxQueryLength = $maxValueLength > 0 ? $maxValueLength : -1;
+}
+
 /**
  * Definitions of the NS_ constants are in Defines.php
  * @private
index b1517e4..8362772 100644 (file)
@@ -1075,22 +1075,16 @@ abstract class Installer {
        }
 
        /**
-        * Checks if suhosin.get.max_value_length is set, and if so, sets
-        * $wgResourceLoaderMaxQueryLength to that value in the generated
-        * LocalSettings file
+        * Checks if suhosin.get.max_value_length is set, and if so generate
+        * a warning because it decreases ResourceLoader performance.
         * @return bool
         */
        protected function envCheckSuhosinMaxValueLength() {
                $maxValueLength = ini_get( 'suhosin.get.max_value_length' );
-               if ( $maxValueLength > 0 ) {
-                       if ( $maxValueLength < 1024 ) {
-                               # Only warn if the value is below the sane 1024
-                               $this->showMessage( 'config-suhosin-max-value-length', $maxValueLength );
-                       }
-               } else {
-                       $maxValueLength = -1;
+               if ( $maxValueLength > 0 &&  $maxValueLength < 1024 ) {
+                       // Only warn if the value is below the sane 1024
+                       $this->showMessage( 'config-suhosin-max-value-length', $maxValueLength );
                }
-               $this->setVar( 'wgResourceLoaderMaxQueryLength', $maxValueLength );
                return true;
        }
 
index 3a9bfe8..cca8a4a 100644 (file)
@@ -349,12 +349,6 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 # Path to the GNU diff3 utility. Used for conflict resolution.
 \$wgDiff3 = \"{$this->values['wgDiff3']}\";
 
-# Query string length limit for ResourceLoader. You should only set this if
-# your web server has a query string length limit (then set it to that limit),
-# or if you have suhosin.get.max_value_length set in php.ini (then set it to
-# that value)
-\$wgResourceLoaderMaxQueryLength = {$this->values['wgResourceLoaderMaxQueryLength']};
-
 {$groupRights}";
        }