Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php |
— | — | @@ -275,21 +275,18 @@ |
276 | 276 | /** |
277 | 277 | * Get the stable revision |
278 | 278 | * @param int $flags |
279 | | - * @return mixed (FlaggedRevision/false) |
| 279 | + * @return mixed (FlaggedRevision/null) |
280 | 280 | */ |
281 | 281 | public function getStableRev( $flags = 0 ) { |
282 | 282 | # Cached results available? |
283 | | - if ( !( $flags & FR_MASTER ) && $this->stableRev !== null ) { |
| 283 | + if ( $this->stableRev == null || ( $flags & FR_MASTER ) ) { |
| 284 | + $srev = FlaggedRevision::newFromStable( $this->getTitle(), $flags ); |
| 285 | + $this->stableRev = $srev ? $srev : false; // false => "found nothing" |
| 286 | + } |
| 287 | + if ( $this->stableRev ) { |
284 | 288 | return $this->stableRev; |
285 | 289 | } |
286 | | - # Do we have one? |
287 | | - $srev = FlaggedRevision::newFromStable( $this->getTitle(), $flags ); |
288 | | - if ( $srev ) { |
289 | | - $this->stableRev = $srev; |
290 | | - } else { |
291 | | - $this->stableRev = false; |
292 | | - } |
293 | | - return $this->stableRev; |
| 290 | + return null; |
294 | 291 | } |
295 | 292 | |
296 | 293 | /** |