From: Tim Starling Date: Fri, 23 May 2008 09:00:08 +0000 (+0000) Subject: Fixed sloppy usage of Database::selectField() in getPreviousRevisionID() and getNextR... X-Git-Tag: 1.31.0-rc.0~47445 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=620e909a97936ec27a91594f6f4e925657b9180d;p=lhc%2Fweb%2Fwiklou.git Fixed sloppy usage of Database::selectField() in getPreviousRevisionID() and getNextRevisionID() --- diff --git a/includes/Title.php b/includes/Title.php index fa80f68a0b..0a227d5ad3 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2932,8 +2932,13 @@ class Title { public function getPreviousRevisionID( $revision, $flags=0 ) { $db = ($flags & GAID_FOR_UPDATE) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); return $db->selectField( 'revision', 'rev_id', - 'rev_page=' . intval( $this->getArticleId($flags) ) . - ' AND rev_id<' . intval( $revision ) . ' ORDER BY rev_id DESC' ); + array( + 'rev_page' => $this->getArticleId($flags), + 'rev_id < ' . intval( $revision ) + ), + __METHOD__, + array( 'ORDER BY' => 'rev_id DESC' ) + ); } /** @@ -2946,8 +2951,13 @@ class Title { public function getNextRevisionID( $revision, $flags=0 ) { $db = ($flags & GAID_FOR_UPDATE) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); return $db->selectField( 'revision', 'rev_id', - 'rev_page=' . intval( $this->getArticleId($flags) ) . - ' AND rev_id>' . intval( $revision ) . ' ORDER BY rev_id' ); + array( + 'rev_page' => $this->getArticleId($flags), + 'rev_id > ' . intval( $revision ) + ), + __METHOD__, + array( 'ORDER BY' => 'rev_id' ) + ); } /**