Page MenuHomeMiraheze

Configure $wgWhitelistReadRegexp for kanrikyarawiki
Closed, ResolvedPublic

Description

On the wiki kanrikyarawiki (or possibly theresnothingbetterwiki, depending on if T11855 is done or not), we would like to add a blacklist preventing visitors to our site from accessing certain namespaces. And naturally, I do that with a whitelist variable, using a negative lookahead in a regular expression to reverse the meaning of the whitelist to a blacklist.

The following code should block access to Draft:*, Notes:*, and User:*/sandbox/*, along with their associated talk pages. At least it does in my tests. The wiki is currently marked as private; you have permission to uncheck private to test, or just make testing our job which is fine too.

$wgWhitelistReadRegexp = [ "#(?!(?:Draft(?:_talk)?:|Notes(?:_talk)?:|User(?:_talk)?:[^/]+/sandbox/))^#" ];