r63818 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63817‎ | r63818 | r63819 >
Date:14:51, 16 March 2010
Author:aaron
Status:ok
Tags:
Comment:
Follow-up r63585: fixed $frev existence checks
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -939,7 +939,7 @@
940940 : FlaggedRevision::newFromTitle( $title, $baseRevId, FR_MASTER );
941941 }
942942 // Is this an edit directly to the stable version? Is it a new page?
943 - if ( $isAllowed && ( $reviewableNewPage || !is_null( $frev ) ) ) {
 943+ if ( $isAllowed && ( $reviewableNewPage || $frev ) ) {
944944 if ( $isNullEdit && $frev ) {
945945 $flags = $frev->getTags(); // Dummy edits always keep previous tags
946946 }
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -144,7 +144,7 @@
145145 $revID = $this->article->getOldIDFromRequest();
146146 $frev = FlaggedRevision::newFromTitle( $this->article->getTitle(), $revID );
147147 # Give a notice if this rev ID corresponds to a reviewed version...
148 - if ( !is_null( $frev ) ) {
 148+ if ( $frev ) {
149149 $time = $wgLang->date( $frev->getTimestamp(), true );
150150 $flags = $frev->getTags();
151151 $quality = FlaggedRevs::isQuality( $flags );
@@ -231,7 +231,7 @@
232232 // Is the page config altered?
233233 $prot = FlaggedRevsXML::lockStatusIcon( $this->article );
234234 // Is there no stable version?
235 - if ( is_null( $frev ) ) {
 235+ if ( !$frev ) {
236236 # Add "no reviewed version" tag, but not for printable output
237237 $this->showUnreviewedPage( $tag, $prot );
238238 return true;
@@ -680,7 +680,7 @@
681681 } elseif ( $this->pageOverride() ) {
682682 $frev = $this->article->getStableRev();
683683 }
684 - if ( !is_null( $frev ) ) {
 684+ if ( $frev ) {
685685 $time = $frev->getFileTimestamp();
686686 // B/C, may be stored in associated image version metadata table
687687 if ( !$time ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63585* Improved handling of intermediate edits and "review changes" checkbox...aaron07:28, 11 March 2010

Status & tagging log