if ( "save" == $formtype ) {
# Check for spam
if ( $wgSpamRegex && preg_match( $wgSpamRegex, $this->textbox1 ) ) {
- sleep(10);
- $wgOut->redirect( $this->mTitle->getFullURL() );
+ if ( $wgUser->isSysop() ) {
+ $this->spamPage();
+ } else {
+ sleep(10);
+ $wgOut->redirect( $this->mTitle->getFullURL() );
+ }
return;
}
if ( $wgUser->isBlocked() ) {
$wgOut->returnToMain( false );
}
+ function spamPage()
+ {
+ global $wgOut, $wgSpamRegex;
+ $wgOut->setPageTitle( wfMsg( "spamprotectiontitle" ) );
+ $wgOut->setRobotpolicy( "noindex,nofollow" );
+ $wgOut->setArticleRelated( false );
+
+ $wgOut->addWikiText( wfMsg( "spamprotectiontext" ) );
+ $wgOut->addWikiText( "<pre>".$wgSpamRegex."</pre>" );
+ $wgOut->returnToMain( false );
+ }
+
# Forks processes to scan the originating IP for an open proxy server
# MemCached can be used to skip IPs that have already been scanned
function proxyCheck()
$this->fatalError( wfMsg( "filenotfound", $name ) );
}
+ // return from error messages or notes
+ // auto: automatically redirect the user after 10 seconds
+ // returnto: page title to return to. Default is Main Page.
function returnToMain( $auto = true, $returnto = NULL )
{
global $wgUser, $wgOut, $wgRequest;
"lastmodifiedby" => "This page was last modified $1 by $2.",
"and" => "and",
"othercontribs" => "Based on work by $1.",
-"siteusers" => "$wgSitename user(s) $1"
+"siteusers" => "$wgSitename user(s) $1",
+"spamprotectiontitle" => "Spam protection filter",
+"spamprotectiontext" => "The page you wanted to save was blocked by the spam filter. This is probably caused by a link to an external site.
+
+You might want to check the following regular expression for patterns that are currently blocked:"
+
);