* Added a hook, SpecialWatchlistGetNonRevisionTypes, to allow extensions
with custom recentchanges entries to hook into the Watchlist without
clobbering each other.
+* A hidden, empty input field was added to the edit form, and any edit that fills
+ it in will be rejected. This prevents against the simplest form of spambots.
+ Previously in the "SimpleAntiSpam" extension by Ryan Schmidt.
=== Bug fixes in 1.22 ===
* Disable Special:PasswordReset when $wgEnableEmail is false. Previously one
return $status;
}
+ $spam = $wgRequest->getText( 'wpAntispam' );
+ if ( $spam !== '' ) {
+ wfDebugLog(
+ 'SimpleAntiSpam',
+ $wgUser->getName() .
+ ' editing "' .
+ $this->mTitle->getPrefixedText() .
+ '" submitted bogus field "' .
+ $spam .
+ '"'
+ );
+ $status->fatal( 'spamprotectionmatch', false );
+ $status->value = self::AS_SPAM_ERROR;
+ wfProfileOut( __METHOD__ . '-checks' );
+ wfProfileOut( __METHOD__ );
+ return $status;
+ }
+
try {
# Construct Content object
$textbox_content = $this->toEditContent( $this->textbox1 );
call_user_func_array( $formCallback, array( &$wgOut ) );
}
+ // Add an empty field to trip up spambots
+ $wgOut->addHTML(
+ Xml::openElement( 'div', array( 'id' => 'antispam-container', 'style' => 'display: none;' ) )
+ . Html::rawElement( 'label', array( 'for' => 'wpAntiSpam' ), wfMessage( 'simpleantispam-label' )->parse() )
+ . Xml::element( 'input', array( 'type' => 'text', 'name' => 'wpAntispam', 'id' => 'wpAntispam', 'value' => '' ) )
+ . Xml::closeElement( 'div' )
+ );
+
wfRunHooks( 'EditPage::showEditForm:fields', array( &$this, &$wgOut ) );
// Put these up at the top to ensure they aren't lost on early form submission
'spam_reverting' => 'Reverting to last revision not containing links to $1',
'spam_blanking' => 'All revisions contained links to $1, blanking',
'spam_deleting' => 'All revisions contained links to $1, deleting',
+'simpleantispam-label' => "Anti-spam check.
+Do '''NOT''' fill this in!",
# Info page
'pageinfo-header' => '-', # do not translate or duplicate this message to other languages