r57648 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57647‎ | r57648 | r57649 >
Date:21:02, 11 October 2009
Author:aaron
Status:ok
Tags:
Comment:
Minor cleanups & comments
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php
@@ -1440,18 +1440,18 @@
14411441 */
14421442 public function addQuickReview( &$data, $top = false, $hide = false ) {
14431443 global $wgOut, $wgUser, $wgRequest;
1444 - # Revision being displayed
 1444+ # Get the revision being displayed
14451445 $id = $wgOut->getRevisionId();
14461446 if( !$id ) {
14471447 if( !$this->isDiffFromStable ) {
14481448 return false; // only safe to assume current if diff-to-stable
 1449+ } else {
 1450+ $rev = Revision::newFromTitle( $this->parent->getTitle() );
 1451+ $id = $rev->getId();
14491452 }
1450 - $rev = Revision::newFromTitle( $this->parent->getTitle() );
1451 - $id = $rev->getId();
14521453 } else {
14531454 $rev = Revision::newFromTitle( $this->parent->getTitle(), $id );
14541455 }
1455 -
14561456 # Load required messages
14571457 wfLoadExtensionMessages( 'FlaggedRevs' );
14581458 # Must be a valid non-printable output and revision must be public
@@ -1587,15 +1587,15 @@
15881588 Xml::closeElement('textarea') . "\n";
15891589 $form .= "</div>\n";
15901590 }
1591 -
 1591+ # Get versions of templates/files used
15921592 $imageParams = $templateParams = $fileVersion = '';
15931593 if( $useCurrent ) {
1594 - global $wgUser, $wgParser, $wgEnableParserCache;
15951594 # Get parsed current version
15961595 $parserCache = ParserCache::singleton();
15971596 $article = $this->parent;
15981597 $currentOutput = $parserCache->get( $article, $wgUser );
1599 - if( $currentOutput==false ) {
 1598+ if( $currentOutput == false ) {
 1599+ global $wgParser, $wgEnableParserCache;
16001600 $text = $article->getContent();
16011601 $title = $article->getTitle();
16021602 $options = FlaggedRevs::makeParserOptions();
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php
@@ -809,7 +809,7 @@
810810 if( !self::userCan($qal,$level,$config) ) {
811811 return false; // user cannot set proposed flag
812812 } elseif( isset($oldflags[$qal]) && !self::userCan($qal,$oldflags[$qal]) ) {
813 - return false; // user cannot change old flag
 813+ return false; // user cannot change old flag ($config is ignored here)
814814 } elseif( $level < 0 || $level > $highest ) {
815815 return false; // flag range is invalid
816816 }

Status & tagging log