r32935 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32934‎ | r32935 | r32936 >
Date:00:13, 8 April 2008
Author:aaron
Status:old
Tags:
Comment:
Use page_latest, not the one before it
Modified paths:
  • /trunk/phase3/includes/Revision.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Revision.php
@@ -564,20 +564,15 @@
565565 }
566566 # Use page_latest if ID is not given
567567 if( !$this->mId ) {
568 - $revID = $db->selectField( 'page', 'page_latest',
 568+ $prevID = $db->selectField( 'page', 'page_latest',
569569 array( 'page_id' => $this->mPage ),
570570 __METHOD__ );
571571 } else {
572 - $revID = $this->mId;
 572+ $prevId = $db->selectField( 'revision', 'rev_id',
 573+ array( 'rev_page' => $this->mPage, 'rev_id < ' . $this->mId ),
 574+ __METHOD__,
 575+ array( 'ORDER BY' => 'rev_id DESC' ) );
573576 }
574 - if( !$revID ) {
575 - return 0;
576 - }
577 - $prevId = $db->selectField( 'revision', 'rev_id',
578 - array( 'rev_page' => $this->mPage, 'rev_id < ' . $revID ),
579 - __METHOD__,
580 - array( 'ORDER BY' => 'rev_id DESC' ) );
581 - # Always return an integer
582577 return intval($prevId);
583578 }
584579

Status & tagging log