Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -103,7 +103,8 @@ |
104 | 104 | 'envCheckExtension', |
105 | 105 | 'envCheckShellLocale', |
106 | 106 | 'envCheckUploadsDirectory', |
107 | | - 'envCheckLibicu' |
| 107 | + 'envCheckLibicu', |
| 108 | + 'envCheckSuhosinMaxValueLength', |
108 | 109 | ); |
109 | 110 | |
110 | 111 | /** |
— | — | @@ -141,6 +142,7 @@ |
142 | 143 | 'wgUseInstantCommons', |
143 | 144 | 'wgUpgradeKey', |
144 | 145 | 'wgDefaultSkin', |
| 146 | + 'wgResourceLoaderMaxQueryLength', |
145 | 147 | ); |
146 | 148 | |
147 | 149 | /** |
— | — | @@ -966,6 +968,21 @@ |
967 | 969 | $this->showMessage( 'config-uploads-not-safe', $dir ); |
968 | 970 | } |
969 | 971 | } |
| 972 | + |
| 973 | + /** |
| 974 | + * Checks if suhosin.get.max_value_length is set, and if so, sets |
| 975 | + * $wgResourceLoaderMaxQueryLength to that value in the generated |
| 976 | + * LocalSettings file |
| 977 | + */ |
| 978 | + protected function envCheckSuhosinMaxValueLength() { |
| 979 | + $maxValueLength = ini_get( 'suhosin.get.max_value_length' ); |
| 980 | + if ( $maxValueLength > 0 ) { |
| 981 | + $this->showMessage( 'config-suhosin-max-value-length', $maxValueLength ); |
| 982 | + } else { |
| 983 | + $maxValueLength = -1; |
| 984 | + } |
| 985 | + $this->setVar( 'wgResourceLoaderMaxQueryLength', $maxValueLength ); |
| 986 | + } |
970 | 987 | |
971 | 988 | /** |
972 | 989 | * Convert a hex string representing a Unicode code point to that code point. |
Index: trunk/phase3/includes/installer/Installer.i18n.php |
— | — | @@ -155,6 +155,7 @@ |
156 | 156 | 'config-using531' => 'MediaWiki cannot be used with PHP $1 due to a bug involving reference parameters to <code>__call()</code>. |
157 | 157 | Upgrade to PHP 5.3.2 or higher, or downgrade to PHP 5.3.0 to resolve this. |
158 | 158 | Installation aborted.', |
| 159 | + 'config-suhosin-max-value-length' => "Suhosin is installed and limits the GET parameter length to $1 bytes. MediaWiki's ResourceLoader component will work around this limit, but that will degrade performance. If at all possible, you should set suhosin.get.max_value_length to 1024 or higher in php.ini , and set \$wgResourceLoaderMaxQueryLength to the same value in LocalSettings.php .", |
159 | 160 | 'config-db-type' => 'Database type:', |
160 | 161 | 'config-db-host' => 'Database host:', |
161 | 162 | 'config-db-host-help' => 'If your database server is on different server, enter the host name or IP address here. |
Index: trunk/phase3/includes/installer/LocalSettingsGenerator.php |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | 'wgRightsText', 'wgRightsCode', 'wgMainCacheType', 'wgEnableUploads', |
48 | 48 | 'wgMainCacheType', '_MemCachedServers', 'wgDBserver', 'wgDBuser', |
49 | 49 | 'wgDBpassword', 'wgUseInstantCommons', 'wgUpgradeKey', 'wgDefaultSkin', |
50 | | - 'wgMetaNamespace' |
| 50 | + 'wgMetaNamespace', 'wgResourceLoaderMaxQueryLength' |
51 | 51 | ), |
52 | 52 | $db->getGlobalNames() |
53 | 53 | ); |
— | — | @@ -307,6 +307,12 @@ |
308 | 308 | |
309 | 309 | # Path to the GNU diff3 utility. Used for conflict resolution. |
310 | 310 | \$wgDiff3 = \"{$this->values['wgDiff3']}\"; |
| 311 | + |
| 312 | +# Query string length limit for ResourceLoader. You should only set this if |
| 313 | +# your web server has a query string length limit (then set it to that limit), |
| 314 | +# or if you have suhosin.get.max_value_length set in php.ini (then set it to |
| 315 | +# that value) |
| 316 | +\$wgResourceLoaderMaxQueryLength = {$this->values['wgResourceLoaderMaxQueryLength']}; |
311 | 317 | "; |
312 | 318 | } |
313 | 319 | |