Localisation updates from https://translatewiki.net.
[lhc/web/wiklou.git] / includes / api / ApiQueryUserInfo.php
index f9eb677..7fc0ba8 100644 (file)
@@ -167,9 +167,9 @@ class ApiQueryUserInfo extends ApiQueryBase {
                if ( isset( $this->prop['unreadcount'] ) ) {
                        $dbr = $this->getQuery()->getNamedDB( 'watchlist', DB_SLAVE, 'watchlist' );
 
-                       $sql = $dbr->selectSQLText(
+                       $count = $dbr->selectRowCount(
                                'watchlist',
-                               array( 'dummy' => 1 ),
+                               '1',
                                array(
                                        'wl_user' => $user->getId(),
                                        'wl_notificationtimestamp IS NOT NULL',
@@ -177,12 +177,11 @@ class ApiQueryUserInfo extends ApiQueryBase {
                                __METHOD__,
                                array( 'LIMIT' => self::WL_UNREAD_LIMIT )
                        );
-                       $count = $dbr->selectField( array( 'c' => "($sql)" ), 'COUNT(*)' );
 
                        if ( $count >= self::WL_UNREAD_LIMIT ) {
                                $vals['unreadcount'] = self::WL_UNREAD_LIMIT . '+';
                        } else {
-                               $vals['unreadcount'] = (int)$count;
+                               $vals['unreadcount'] = $count;
                        }
                }
 
@@ -256,7 +255,7 @@ class ApiQueryUserInfo extends ApiQueryBase {
                );
        }
 
-       public function getExamplesMessages() {
+       protected function getExamplesMessages() {
                return array(
                        'action=query&meta=userinfo'
                                => 'apihelp-query+userinfo-example-simple',