Index: trunk/extensions/FlaggedRevs/specialpages/ReaderFeedback_body.php |
— | — | @@ -205,8 +205,7 @@ |
206 | 206 | # Use page_latest if $revId not given |
207 | 207 | $revId = $revId ? $revId : $title->getLatestRevID( GAID_FOR_UPDATE ); |
208 | 208 | $rev = Revision::newFromTitle( $title, $revId ); |
209 | | - if( !$rev ) |
210 | | - return false; // shouldn't happen; just in case |
| 209 | + if( !$rev ) return false; // shouldn't happen; just in case |
211 | 210 | # Check if this revision is by this user... |
212 | 211 | if( $rev->getUserText() === $wgUser->getName() ) { |
213 | 212 | # Check if the previous revisions is theirs and they |
— | — | @@ -223,10 +222,10 @@ |
224 | 223 | # Check if user already voted before... |
225 | 224 | $dbw = wfGetDB( DB_MASTER ); |
226 | 225 | if( $wgUser->getId() ) { |
227 | | - $ipSafe = $dbw->strencode( wfGetIP() ); |
| 226 | + $ipSafe = $dbw->addQuotes( wfGetIP() ); |
228 | 227 | $userVoted = $dbw->selectField( 'reader_feedback', '1', |
229 | 228 | array( 'rfb_rev_id' => $revId, |
230 | | - "(rfb_user = ".$wgUser->getId().") OR (rfb_user = 0 AND rfb_ip = '$ipSafe')" ), |
| 229 | + "(rfb_user = ".$wgUser->getId().") OR (rfb_user = 0 AND rfb_ip = $ipSafe)" ), |
231 | 230 | __METHOD__ ); |
232 | 231 | if( $userVoted ) { |
233 | 232 | return true; |