r79931 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79930‎ | r79931 | r79932 >
Date:08:37, 10 January 2011
Author:ialex
Status:deferred
Tags:
Comment:
Use Title::getLatestRevID() instead of grabbing it from $wgArticle
Modified paths:
  • /trunk/extensions/ReaderFeedback/ReaderFeedback.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ReaderFeedback/ReaderFeedback.hooks.php
@@ -70,10 +70,10 @@
7171 }
7272
7373 public static function addFeedbackForm( &$data, $skin ) {
74 - global $wgOut, $wgArticle;
 74+ global $wgOut;
7575 $title = $skin->getTitle();
76 - if( $wgOut->isArticleRelated() && isset($wgArticle) ) {
77 - global $wgRequest, $wgUser, $wgOut;
 76+ if( $wgOut->isArticleRelated() ) {
 77+ global $wgRequest, $wgUser;
7878 if( !$title->exists() || !ReaderFeedback::isPageRateable($title) || !$wgOut->getRevisionId() ) {
7979 return true;
8080 }
@@ -85,7 +85,7 @@
8686 if( $wgUser->isAllowed( 'feedback' ) ) {
8787 # Only allow votes on the latest revision!
8888 $id = $wgOut->getRevisionId();
89 - if( $id != $wgArticle->getLatest() ) {
 89+ if( $id != $title->getLatestRevID() ) {
9090 return true;
9191 }
9292 # If the user already voted, then don't show the form.

Status & tagging log