From 55561aef1777fae4ca1a2bd0d1f8814f8c9fc30a Mon Sep 17 00:00:00 2001 From: Reedy Date: Mon, 18 Jan 2021 18:44:40 +0000 Subject: [PATCH] Pingback.php: Minor cleanup * Fix comments at end of lines of code * Swap ini_get( 'memory_limit' ) comparison to !== and compare to a string ** ini_get returns a string - https://www.php.net/manual/en/function.ini-get.php Change-Id: I3026578cbe5189fdb703233c25aaa42cfa2cb664 --- includes/Pingback.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/Pingback.php b/includes/Pingback.php index 549cbdd4b9c..6fc7b311238 100644 --- a/includes/Pingback.php +++ b/includes/Pingback.php @@ -147,12 +147,14 @@ class Pingback { private function acquireLock() : bool { $cacheKey = $this->cache->makeKey( 'pingback', $this->key ); if ( !$this->cache->add( $cacheKey, 1, $this->cache::TTL_HOUR ) ) { - return false; // throttled + // throttled + return false; } $dbw = $this->lb->getConnectionRef( DB_MASTER ); if ( !$dbw->lock( $this->key, __METHOD__, 0 ) ) { - return false; // already in progress + // already in progress + return false; } return true; @@ -200,7 +202,7 @@ class Pingback { } $limit = ini_get( 'memory_limit' ); - if ( $limit && $limit != -1 ) { + if ( $limit && $limit !== "-1" ) { $event['memoryLimit'] = $limit; }