summaryrefslogtreecommitdiff
path: root/extensions/SpamBlacklist/SpamBlacklist_body.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2014-12-27 15:41:37 +0100
committerPierre Schmitz <pierre@archlinux.de>2014-12-31 11:43:28 +0100
commitc1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch)
tree2b38796e738dd74cb42ecd9bfd151803108386bc /extensions/SpamBlacklist/SpamBlacklist_body.php
parentb88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff)
Update to MediaWiki 1.24.1
Diffstat (limited to 'extensions/SpamBlacklist/SpamBlacklist_body.php')
-rw-r--r--extensions/SpamBlacklist/SpamBlacklist_body.php9
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();
}