diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-06-04 07:31:04 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-06-04 07:58:39 +0200 |
commit | f6d65e533c62f6deb21342d4901ece24497b433e (patch) | |
tree | f28adf0362d14bcd448f7b65a7aaf38650f923aa /extensions/SpamBlacklist/SpamBlacklist_body.php | |
parent | c27b2e832fe25651ef2410fae85b41072aae7519 (diff) |
Update to MediaWiki 1.25.1
Diffstat (limited to 'extensions/SpamBlacklist/SpamBlacklist_body.php')
-rw-r--r-- | extensions/SpamBlacklist/SpamBlacklist_body.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/extensions/SpamBlacklist/SpamBlacklist_body.php b/extensions/SpamBlacklist/SpamBlacklist_body.php index 15fbc72f..8c270f42 100644 --- a/extensions/SpamBlacklist/SpamBlacklist_body.php +++ b/extensions/SpamBlacklist/SpamBlacklist_body.php @@ -41,9 +41,6 @@ class SpamBlacklist extends BaseBlacklist { * @return Array Matched text(s) if the edit should not be allowed, false otherwise */ function filter( array $links, Title $title = null, $preventLog = false ) { - $fname = 'wfSpamBlacklistFilter'; - wfProfileIn( $fname ); - $blacklists = $this->getBlacklists(); $whitelists = $this->getWhitelists(); @@ -94,7 +91,10 @@ class SpamBlacklist extends BaseBlacklist { wfDebugLog( 'SpamBlacklist', "Match!\n" ); global $wgRequest; $ip = $wgRequest->getIP(); - $imploded = implode( ' ', $matches[0] ); + $fullUrls = array(); + $fullLineRegex = substr( $regex, 0, strrpos( $regex, '/' ) ) . '.*/Sim'; + preg_match_all( $fullLineRegex, $links, $fullUrls ); + $imploded = implode( ' ', $fullUrls[0] ); wfDebugLog( 'SpamBlacklistHit', "$ip caught submitting spam: $imploded\n" ); if( !$preventLog ) { $this->logFilterHit( $title, $imploded ); // Log it @@ -102,7 +102,7 @@ class SpamBlacklist extends BaseBlacklist { if( $retVal === false ){ $retVal = array(); } - $retVal = array_merge( $retVal, $matches[1] ); + $retVal = array_merge( $retVal, $fullUrls[1] ); } } if ( is_array( $retVal ) ) { @@ -111,7 +111,7 @@ class SpamBlacklist extends BaseBlacklist { } else { $retVal = false; } - wfProfileOut( $fname ); + return $retVal; } |