From 7016d1bb31a737e35f4645de565ef71f91541543 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sun, 30 Jun 2019 00:01:21 +0200 Subject: [PATCH] Pass column as string to IDatabase::selectField To match documentation Change-Id: I7ee69fcd90ba1cba947ca2ef205f350dc456a2c7 --- includes/auth/LocalPasswordPrimaryAuthenticationProvider.php | 2 +- .../auth/TemporaryPasswordPrimaryAuthenticationProvider.php | 2 +- includes/deferred/UserEditCountUpdate.php | 2 +- includes/specials/pagers/BlockListPager.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/auth/LocalPasswordPrimaryAuthenticationProvider.php b/includes/auth/LocalPasswordPrimaryAuthenticationProvider.php index b646380a04..7d02a826b1 100644 --- a/includes/auth/LocalPasswordPrimaryAuthenticationProvider.php +++ b/includes/auth/LocalPasswordPrimaryAuthenticationProvider.php @@ -199,7 +199,7 @@ class LocalPasswordPrimaryAuthenticationProvider list( $db, $options ) = \DBAccessObjectUtils::getDBOptions( $flags ); return (bool)wfGetDB( $db )->selectField( [ 'user' ], - [ 'user_id' ], + 'user_id', [ 'user_name' => $username ], __METHOD__, $options diff --git a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php index e129538bbc..42a1c24fd1 100644 --- a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php +++ b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php @@ -206,7 +206,7 @@ class TemporaryPasswordPrimaryAuthenticationProvider list( $db, $options ) = \DBAccessObjectUtils::getDBOptions( $flags ); return (bool)wfGetDB( $db )->selectField( [ 'user' ], - [ 'user_id' ], + 'user_id', [ 'user_name' => $username ], __METHOD__, $options diff --git a/includes/deferred/UserEditCountUpdate.php b/includes/deferred/UserEditCountUpdate.php index e9ebabb643..3ccb4a8cc1 100644 --- a/includes/deferred/UserEditCountUpdate.php +++ b/includes/deferred/UserEditCountUpdate.php @@ -95,7 +95,7 @@ class UserEditCountUpdate implements DeferrableUpdate, MergeableUpdate { } $newCount = (int)$dbw->selectField( 'user', - [ 'user_editcount' ], + 'user_editcount', [ 'user_id' => $userId ], $fname ); diff --git a/includes/specials/pagers/BlockListPager.php b/includes/specials/pagers/BlockListPager.php index f7ad80cb8b..01aed22726 100644 --- a/includes/specials/pagers/BlockListPager.php +++ b/includes/specials/pagers/BlockListPager.php @@ -365,7 +365,7 @@ class BlockListPager extends TablePager { function getTotalAutoblocks() { $dbr = $this->getDatabase(); $res = $dbr->selectField( 'ipblocks', - [ 'COUNT(*) AS totalautoblocks' ], + 'COUNT(*)', [ 'ipb_auto' => '1', 'ipb_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() ), -- 2.20.1