Pass column as string to IDatabase::selectField
authorUmherirrender <umherirrender_de.wp@web.de>
Sat, 29 Jun 2019 22:01:21 +0000 (00:01 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Sat, 29 Jun 2019 22:01:21 +0000 (00:01 +0200)
To match documentation

Change-Id: I7ee69fcd90ba1cba947ca2ef205f350dc456a2c7

includes/auth/LocalPasswordPrimaryAuthenticationProvider.php
includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php
includes/deferred/UserEditCountUpdate.php
includes/specials/pagers/BlockListPager.php

index b646380..7d02a82 100644 (file)
@@ -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
index e129538..42a1c24 100644 (file)
@@ -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
index e9ebabb..3ccb4a8 100644 (file)
@@ -95,7 +95,7 @@ class UserEditCountUpdate implements DeferrableUpdate, MergeableUpdate {
                                }
                                $newCount = (int)$dbw->selectField(
                                        'user',
-                                       [ 'user_editcount' ],
+                                       'user_editcount',
                                        [ 'user_id' => $userId ],
                                        $fname
                                );
index f7ad80c..01aed22 100644 (file)
@@ -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() ),