summaryrefslogtreecommitdiff
path: root/extensions/SpamBlacklist/SpamBlacklist_body.php
diff options
context:
space:
mode:
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();
}