Page MenuHomeMiraheze

Enable StringFunctions inside of ParserFunctions
Closed, DeclinedPublic

Description

This is a request for allthetropeswiki but I honestly don't see why it shouldn't be default for everyone.

https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#StringFunctions

All of these functions (len, pos, rpos, sub, replace, explode) are integrated from the StringFunctions extension, but are only available if an administrator sets $wgPFEnableStringFunctions = true; in LocalSettings.php.
All of these functions operate in O(n) time complexity, making them safe against DoS attacks.

Note we already have Extension:Regex Functions as an option -- these should be cheaper and easier not to screw up.

So, I propose adding this:

'wgPFEnableStringFunctions' => [
		'default' => true,
	],

Event Timeline

This is already in ManageWiki - https://github.com/miraheze/mw-config/blob/affa19c5f7948efdb3968e2c63f1cdfd6722aa7e/ManageWikiSettings.php#L846 but I wouldn't object to flipping it to on by default in there.

Unknown Object (User) subscribed.Apr 10 2021, 21:21

To expand on what RhinosF1 said, this can be done in the "Parser Functions" tab of ManageWiki.

Herald removed a subscriber: Unknown Object (User). · View Herald TranscriptApr 10 2021, 21:21

Yeah, just noticed. I guess this closes my first request, but it's kind of up to you guys if you think it would be good as default. I think it would be mostly harmless.

Damn, ManageWiki has gotten a lot better since I'd played around with it last. Good job, guys.

Unknown Object (User) added a comment.Apr 11 2021, 01:02

$wgPFEnableStringFunctions is not on by default because that's not the extension default and as far as I'm aware we usually set our defaults to the extension defaults.

labster claimed this task.

Fair enough. I've talked to another user and we were both confused on how this works; maybe it's just us. If this comes up again, we might want to implement the suggestion, but otherwise closing this request.