$wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
}
-// Default value is either the suhosin limit or -1 for unlimited
+// Default value is 2000 or the suhosin limit if it is between 1 and 2000
if ( $wgResourceLoaderMaxQueryLength === false ) {
- $maxValueLength = ini_get( 'suhosin.get.max_value_length' );
- $wgResourceLoaderMaxQueryLength = $maxValueLength > 0 ? $maxValueLength : -1;
+ $suhosinMaxValueLength = (int) ini_get( 'suhosin.get.max_value_length' );
+ if ( $suhosinMaxValueLength > 0 && $suhosinMaxValueLength < 2000 ) {
+ $wgResourceLoaderMaxQueryLength = $suhosinMaxValueLength;
+ } else {
+ $wgResourceLoaderMaxQueryLength = 2000;
+ }
+ unset($suhosinMaxValueLength);
}
/**
};
// Split module batch by source and by group.
splits = {};
- maxQueryLength = mw.config.get( 'wgResourceLoaderMaxQueryLength', -1 );
+ maxQueryLength = mw.config.get( 'wgResourceLoaderMaxQueryLength', 2000 );
// Appends a list of modules from the queue to the batch
for ( q = 0; q < queue.length; q += 1 ) {
moduleMap = {};
async = true;
l = currReqBaseLength + 9;
+ mw.track( 'resourceloader.splitRequest', { maxQueryLength: maxQueryLength } );
}
if ( !hasOwn.call( moduleMap, prefix ) ) {
moduleMap[prefix] = [];