From 7a67ab0a5d9da466e8c5fb5a7556e33e710ac9bd Mon Sep 17 00:00:00 2001 From: Reedy Date: Fri, 8 Apr 2022 14:10:31 +0100 Subject: [PATCH] Fix and enable 1 PHPCS exclusion Change-Id: Iee1fb7c926b301a9980e8f1d2b447fb6ef169c6e --- .phpcs.xml | 1 - includes/SpamBlacklist.php | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.phpcs.xml b/.phpcs.xml index 8c016ef5..8f5fdc1f 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -3,7 +3,6 @@ - diff --git a/includes/SpamBlacklist.php b/includes/SpamBlacklist.php index 28add860..5258b7d1 100644 --- a/includes/SpamBlacklist.php +++ b/includes/SpamBlacklist.php @@ -88,7 +88,8 @@ class SpamBlacklist extends BaseBlacklist { } } elseif ( $mode === 'stash' ) { if ( $knownNonMatchAsOf && ( time() - $knownNonMatchAsOf ) < self::STASH_AGE_DYING ) { - return false; // OK; not about to expire soon + // OK; not about to expire soon + return false; } } @@ -147,7 +148,7 @@ class SpamBlacklist extends BaseBlacklist { $imploded = implode( ' ', $fullUrls[0] ); wfDebugLog( 'SpamBlacklistHit', "$ip caught submitting spam: $imploded\n" ); if ( !$preventLog && $title ) { - $this->logFilterHit( $user, $title, $imploded ); // Log it + $this->logFilterHit( $user, $title, $imploded ); } if ( $retVal === false ) { $retVal = []; @@ -195,7 +196,8 @@ class SpamBlacklist extends BaseBlacklist { return $dbr->selectFieldValues( 'externallinks', 'el_to', - [ 'el_from' => $title->getArticleID() ], // should be zero queries + // should be zero queries + [ 'el_from' => $title->getArticleID() ], $fname ); } @@ -207,7 +209,8 @@ class SpamBlacklist extends BaseBlacklist { $entries, $title, $user, - true /* no logging */, + // no logging + true, 'stash' ); }