mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SpamBlacklist
synced 2024-11-28 00:50:28 +00:00
Added some minor backwards-compatibility, so trunk version can work with MW 1.16 and earlier
This commit is contained in:
parent
a65164269c
commit
b6408039cd
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue