Page MenuHomeMiraheze

Enable StringFunctions inside of ParserFunctions
Closed, DeclinedPublic


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

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 - but I wouldn't object to flipping it to on by default in there.

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

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.

$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.