diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2014-12-27 15:41:37 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2014-12-31 11:43:28 +0100 |
commit | c1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch) | |
tree | 2b38796e738dd74cb42ecd9bfd151803108386bc /extensions/SpamBlacklist/SpamBlacklist_body.php | |
parent | b88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff) |
Update to MediaWiki 1.24.1
Diffstat (limited to 'extensions/SpamBlacklist/SpamBlacklist_body.php')
-rw-r--r-- | extensions/SpamBlacklist/SpamBlacklist_body.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/extensions/SpamBlacklist/SpamBlacklist_body.php b/extensions/SpamBlacklist/SpamBlacklist_body.php index bf5c9aab..15fbc72f 100644 --- a/extensions/SpamBlacklist/SpamBlacklist_body.php +++ b/extensions/SpamBlacklist/SpamBlacklist_body.php @@ -34,10 +34,13 @@ class SpamBlacklist extends BaseBlacklist { * This is used to load the old links already on the page, so * the filter is only applied to links that got added. If not given, * the filter is applied to all $links. + * @param boolean $preventLog Whether to prevent logging of hits. Set to true when + * the action is testing the links rather than attempting to save them + * (e.g. the API spamblacklist action) * * @return Array Matched text(s) if the edit should not be allowed, false otherwise */ - function filter( array $links, Title $title = null ) { + function filter( array $links, Title $title = null, $preventLog = false ) { $fname = 'wfSpamBlacklistFilter'; wfProfileIn( $fname ); @@ -93,7 +96,9 @@ class SpamBlacklist extends BaseBlacklist { $ip = $wgRequest->getIP(); $imploded = implode( ' ', $matches[0] ); wfDebugLog( 'SpamBlacklistHit', "$ip caught submitting spam: $imploded\n" ); - $this->logFilterHit( $title, $imploded ); // Log it + if( !$preventLog ) { + $this->logFilterHit( $title, $imploded ); // Log it + } if( $retVal === false ){ $retVal = array(); } |