r24468 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24467‎ | r24468 | r24469 >
Date:16:23, 30 July 2007
Author:robchurch
Status:old
Tags:
Comment:
Don't assume we're getting a ResultWrapper back from Database::select(); incompatible with 1.10.x otherwise
Modified paths:
  • /trunk/extensions/BackAndForth/BackAndForth.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/BackAndForth/BackAndForth.class.php
@@ -64,8 +64,9 @@
6565 'LIMIT' => 1,
6666 )
6767 );
68 - if( $res->numRows() > 0 ) {
69 - $row = $res->fetchObject();
 68+ if( $dbr->numRows( $res ) > 0 ) {
 69+ $row = $dbr->fetchObject( $res );
 70+ $dbr->freeResult( $res );
7071 $target = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
7172 if( $target instanceof Title ) {
7273 $label = htmlspecialchars( wfMsg( "backforth-{$label}", $target->getPrefixedText() ) );

Status & tagging log