Content banning allows you to stop editors from saving pages which have certain content. Unfortunately this method uses a regular expression and so most people won't be able to do anything complex without risking their sanity.
div blocks in MediaWiki ∞
There is no functionality to create an array of regular expressions, for tidier presentation.
so edits which include
<div should be blocked. (I can't see any of my regular users using
You could also just use:
- Blocking more than one string
$wgSpamRegexLines = 'display\s*:\s*none'; $wgSpamRegexLines = 'overflow:\s*\s*auto'; // [...] $wgSpamRegex = '/(' . implode( '|', $wgSpamRegexLines ) . ')/i';
Also, I believe that this combination of the two will work, but I haven't had a chance to test it yet:
Regex inline-commenting has not been tested, but this would be nice to use for more complex patterns.
Props to evernex.com for this beauty:
$wgSpamRegex = "/\<.*style.*?(display|position|overflow|visibility|height)\s*:.*?>/i";
I had this for a while.. but I don't think it works!!
$wgSpamRegex = "/". "overflow:\s*auto;\s*height:\s*[0-4]px;|". "\<\s*a\s*href|". "style\s*=\s*\"\s*display\s*:\s*none". "/i";
banning spam links ∞
[[http://example.org some text]]
$wgSpamRegex = "/\[\[http:|^\[[^]*\]/";
Notes / Resources ∞
Bad Image List -- Ban certain filenames.