r44594 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44593‎ | r44594 | r44595 >
Date:21:00, 14 December 2008
Author:aaron
Status:ok
Tags:
Comment:
Disallow reviews with no user ID or IP
Modified paths:
  • /trunk/extensions/FlaggedRevs/specialpages/ReaderFeedback_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/specialpages/ReaderFeedback_body.php
@@ -259,6 +259,10 @@
260260 if( !$rev || !$rev->getTitle()->equals( $this->page ) ) {
261261 return false; // opps!
262262 }
 263+ $ip = wfGetIP();
 264+ if( !$wgUser->getId() && !$ip ) {
 265+ return false; // we need to keep track somehow
 266+ }
263267 $article = new Article( $this->page );
264268 # Check if user already voted before...
265269 if( self::userAlreadyVoted( $this->page, $this->oldid ) ) {
@@ -268,7 +272,7 @@
269273 $insertRow = array(
270274 'rfb_rev_id' => $this->oldid,
271275 'rfb_user' => $wgUser->getId(),
272 - 'rfb_ip' => wfGetIP(),
 276+ 'rfb_ip' => $ip,
273277 'rfb_timestamp' => $dbw->timestamp(),
274278 'rfb_ratings' => $ratings
275279 );

Status & tagging log