jenkins-bot has submitted this change and it was merged. Change subject: Installer: Remove wgResourceLoaderMaxQueryLength in LocalSettings ......................................................................
Installer: Remove wgResourceLoaderMaxQueryLength in LocalSettings This can change from one web server to another. Hardcoding it in LocalSettings is unnececary (and could even cause problems when a MediaWiki install is moved to a server with a lower limit than the original server, as ResourceLoader would still be acting on the old limit). Similar to how wgUsePathInfo is currently dynamically set. The less cruft in LocalSettings by default the better imho. Except for stuff that makes sense to be sticky, explicit and cached. Or stuff that is every commonly enabled and is therefor convinient (such as wgEnableUploads/wgUseInstantCommons). Change-Id: I58cb185f8dc1650a76c60c7fd04767fb74b32be2 --- M includes/DefaultSettings.php M includes/Setup.php M includes/installer/Installer.php M includes/installer/LocalSettingsGenerator.php 4 files changed, 15 insertions(+), 18 deletions(-) Approvals: Hoo man: Looks good to me, but someone else must approve Demon: Looks good to me, approved Parent5446: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 58eb3d7..528eb9e 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3036,8 +3036,10 @@ * * 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 diff --git a/includes/Setup.php b/includes/Setup.php index d8c9180..028758f 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -293,6 +293,13 @@ $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 diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index b1517e4..8362772 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -1075,22 +1075,16 @@ } /** - * 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; } diff --git a/includes/installer/LocalSettingsGenerator.php b/includes/installer/LocalSettingsGenerator.php index 3a9bfe8..cca8a4a 100644 --- a/includes/installer/LocalSettingsGenerator.php +++ b/includes/installer/LocalSettingsGenerator.php @@ -349,12 +349,6 @@ # 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}"; } -- To view, visit https://gerrit.wikimedia.org/r/67033 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I58cb185f8dc1650a76c60c7fd04767fb74b32be2 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: Catrope <roan.katt...@gmail.com> Gerrit-Reviewer: Demon <ch...@wikimedia.org> Gerrit-Reviewer: Hoo man <h...@online.de> Gerrit-Reviewer: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: Parent5446 <tylerro...@gmail.com> Gerrit-Reviewer: Reedy <re...@wikimedia.org> Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org> Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits