r82314 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82313‎ | r82314 | r82315 >
Date:00:24, 17 February 2011
Author:yaron
Status:deferred
Tags:
Comment:
Added some minor backwards-compatibility, so trunk version can work with MW 1.16 and earlier
Modified paths:
  • /trunk/extensions/SpamBlacklist/SpamBlacklist.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SpamBlacklist/SpamBlacklist.php
@@ -84,8 +84,13 @@
8585 $spamObj = wfSpamBlacklistObject();
8686 $title = $editPage->mArticle->getTitle();
8787 $ret = $spamObj->filter( $title, $text, '', $editSummary, $editPage );
88 - if ( $ret !== false ){
89 - $editPage->spamPageWithContent( $ret );
 88+ if ( $ret !== false ) {
 89+ // spamPageWithContent() method was added in MW 1.17
 90+ if ( method_exists( $editPage, 'spamPageWithContent' ) ) {
 91+ $editPage->spamPageWithContent( $ret );
 92+ } else {
 93+ $editPage->spamPage( $ret );
 94+ }
9095 }
9196 // Return convention for hooks is the inverse of $wgFilterCallback
9297 return ( $ret === false );

Status & tagging log