Fix database access in ApiSetNotificationTimestamp
authorBrad Jorsch <bjorsch@wikimedia.org>
Sat, 22 Dec 2012 19:54:03 +0000 (14:54 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Sat, 22 Dec 2012 19:54:03 +0000 (14:54 -0500)
ApiBase::getDB() doesn't take a parameter indicating whether DB_SLAVE or
DB_MASTER is wanted. Use wfGetDB() instead.

Change-Id: Ic2057a1561ad31a0638eea6bae887982a4fe8d80

includes/api/ApiSetNotificationTimestamp.php

index 098b1a6..c122f59 100644 (file)
@@ -49,7 +49,7 @@ class ApiSetNotificationTimestamp extends ApiBase {
                $args = array_merge( array( $params, 'entirewatchlist' ), array_keys( $pageSet->getAllowedParams() ) );
                call_user_func_array( array( $this, 'requireOnlyOneParameter' ), $args );
 
-               $dbw = $this->getDB( DB_MASTER );
+               $dbw = wfGetDB( DB_MASTER, 'api' );
 
                $timestamp = null;
                if ( isset( $params['timestamp'] ) ) {