Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -131,8 +131,12 @@ |
132 | 132 | if ( "save" == $formtype ) { |
133 | 133 | # Check for spam |
134 | 134 | if ( $wgSpamRegex && preg_match( $wgSpamRegex, $this->textbox1 ) ) { |
135 | | - sleep(10); |
136 | | - $wgOut->redirect( $this->mTitle->getFullURL() ); |
| 135 | + if ( $wgUser->isSysop() ) { |
| 136 | + $this->spamPage(); |
| 137 | + } else { |
| 138 | + sleep(10); |
| 139 | + $wgOut->redirect( $this->mTitle->getFullURL() ); |
| 140 | + } |
137 | 141 | return; |
138 | 142 | } |
139 | 143 | if ( $wgUser->isBlocked() ) { |
— | — | @@ -471,6 +475,18 @@ |
472 | 476 | $wgOut->returnToMain( false ); |
473 | 477 | } |
474 | 478 | |
| 479 | + function spamPage() |
| 480 | + { |
| 481 | + global $wgOut, $wgSpamRegex; |
| 482 | + $wgOut->setPageTitle( wfMsg( "spamprotectiontitle" ) ); |
| 483 | + $wgOut->setRobotpolicy( "noindex,nofollow" ); |
| 484 | + $wgOut->setArticleRelated( false ); |
| 485 | + |
| 486 | + $wgOut->addWikiText( wfMsg( "spamprotectiontext" ) ); |
| 487 | + $wgOut->addWikiText( "<pre>".$wgSpamRegex."</pre>" ); |
| 488 | + $wgOut->returnToMain( false ); |
| 489 | + } |
| 490 | + |
475 | 491 | # Forks processes to scan the originating IP for an open proxy server |
476 | 492 | # MemCached can be used to skip IPs that have already been scanned |
477 | 493 | function proxyCheck() |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -586,6 +586,9 @@ |
587 | 587 | $this->fatalError( wfMsg( "filenotfound", $name ) ); |
588 | 588 | } |
589 | 589 | |
| 590 | + // return from error messages or notes |
| 591 | + // auto: automatically redirect the user after 10 seconds |
| 592 | + // returnto: page title to return to. Default is Main Page. |
590 | 593 | function returnToMain( $auto = true, $returnto = NULL ) |
591 | 594 | { |
592 | 595 | global $wgUser, $wgOut, $wgRequest; |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -1547,8 +1547,13 @@ |
1548 | 1548 | "lastmodifiedby" => "This page was last modified $1 by $2.", |
1549 | 1549 | "and" => "and", |
1550 | 1550 | "othercontribs" => "Based on work by $1.", |
1551 | | -"siteusers" => "$wgSitename user(s) $1" |
| 1551 | +"siteusers" => "$wgSitename user(s) $1", |
| 1552 | +"spamprotectiontitle" => "Spam protection filter", |
| 1553 | +"spamprotectiontext" => "The page you wanted to save was blocked by the spam filter. This is probably caused by a link to an external site. |
1552 | 1554 | |
| 1555 | +You might want to check the following regular expression for patterns that are currently blocked:" |
| 1556 | + |
| 1557 | + |
1553 | 1558 | ); |
1554 | 1559 | |
1555 | 1560 | #-------------------------------------------------------------------------- |