Added some minor backwards-compatibility, so trunk version can work with MW 1.16 and earlier

This commit is contained in:
Yaron Koren 2011-02-17 00:24:24 +00:00
parent a65164269c
commit b6408039cd

View file

@ -84,8 +84,13 @@ function wfSpamBlacklistFilterMerged( $editPage, $text, &$hookErr, $editSummary
$spamObj = wfSpamBlacklistObject();
$title = $editPage->mArticle->getTitle();
$ret = $spamObj->filter( $title, $text, '', $editSummary, $editPage );
if ( $ret !== false ){
$editPage->spamPageWithContent( $ret );
if ( $ret !== false ) {
// spamPageWithContent() method was added in MW 1.17
if ( method_exists( $editPage, 'spamPageWithContent' ) ) {
$editPage->spamPageWithContent( $ret );
} else {
$editPage->spamPage( $ret );
}
}
// Return convention for hooks is the inverse of $wgFilterCallback
return ( $ret === false );