if ( "save" == $formtype ) {
# Check for spam
- if ( $wgSpamRegex && preg_match( $wgSpamRegex, $this->textbox1 ) ) {
- $this->spamPage();
+ if ( $wgSpamRegex && preg_match( $wgSpamRegex, $this->textbox1, $matches ) ) {
+ $this->spamPage ( $matches );
return;
}
if ( $wgFilterCallback && $wgFilterCallback( $this->mTitle, $this->textbox1, $this->section ) ) {
$wgOut->returnToMain( false );
}
- function spamPage()
+ function spamPage ( $matches = array() )
{
global $wgOut;
$wgOut->setPageTitle( wfMsg( "spamprotectiontitle" ) );
$wgOut->setRobotpolicy( "noindex,nofollow" );
$wgOut->setArticleRelated( false );
- $wgOut->addWikiText( wfMsg( "spamprotectiontext" ) );
+ $wgOut->addWikiText( wfMsg( 'spamprotectiontext' ) );
+ if ( isset ( $matches[0] ) ) {
+ $wgOut->addWikiText( wfMsg( 'spamprotectionmatch', "<nowiki>{$matches[0]}</nowiki>" ) );
+ }
$wgOut->returnToMain( false );
}
'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.',
+'spamprotectionmatch' => 'The following text is what triggered our spam filter: $1',
'subcategorycount' => "There are $1 subcategories to this category.",
'subcategorycount1' => "There is $1 subcategorie to this category.",
'categoryarticlecount' => "There are $1 articles in this category.",