r50754 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50753‎ | r50754 | r50755 >
Date:21:07, 18 May 2009
Author:aaron
Status:ok
Tags:
Comment:
(bug 18744) Suppress useless review link for deleted revs
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php
@@ -1309,12 +1309,16 @@
13101310 if( !$this->isDiffFromStable ) {
13111311 return false; // only safe to assume current if diff-to-stable
13121312 }
1313 - $id = $this->parent->getTitle()->getLatestRevID(GAID_FOR_UPDATE);
 1313+ $rev = Revision::newFromTitle( $this->parent->getTitle() );
 1314+ $id = $rev->getId();
 1315+ } else {
 1316+ $rev = Revision::newFromTitle( $this->parent->getTitle(), $id );
13141317 }
 1318+
13151319 # Load required messages
13161320 wfLoadExtensionMessages( 'FlaggedRevs' );
1317 - # Must be a valid non-printable output
1318 - if( !$id || $wgOut->isPrintable() ) {
 1321+ # Must be a valid non-printable output and revision must be public
 1322+ if( $wgOut->isPrintable() || !$rev || $rev->isDeleted(Revision::DELETED_TEXT) ) {
13191323 return false;
13201324 }
13211325 $useCurrent = false;

Status & tagging log