Hi all,

I discussed with Platonides and the Suhosin author an automatic MediaWiki 
run-time adaption of 
$wgResourceLoaderMaxQueryLength [1-3]. 

Currently, Suhosin and the setting of 
suhosin.get.max_value_length is detected and signalled _only_ during the MW 
installation.

However, if the system (Suhosin) settings are changed after the MW installation,
it requires knowledge about this fact and and it requires to adapt 
the setting manually in any Mediawiki installation on this server.

I now suggest to add something to the core which can adapt the 
$wgResourceLoaderMaxQueryLength also during run-time but still in the limits 
given by a previous 
$wgResourceLoaderMaxQueryLength in LocalSettings.

// Design idea 
//
// In LocalSettings / DefaultSettings
// example of a user value from e.g. LocalSettings
// this value may be cropped at run-time 
// to suhosin.get.max_value_length (if Suhosin extension is active)
$wgResourceLoaderMaxQueryLength = 5212; 



/* In MW core after LocalSettings */

if ( extension_installed( "suhosin" ) && ini_get( 
"suhosin.get.max_value_length" ) ) {

   $wgResourceLoaderMaxQueryLength = min( $wgResourceLoaderMaxQueryLength, 
ini_get( "suhosin.get.max_value_length" ) );

}

[1] https://www.mediawiki.org/wiki/Manual:$wgResourceLoaderMaxQueryLength
[2] https://www.mediawiki.org/wiki/Manual:Suhosin
[3] https://github.com/stefanesser/suhosin/issues/4#issuecomment-3816249



Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to