From 7e65ec1e61101f8f747ab7e26f2932c907125447 Mon Sep 17 00:00:00 2001 From: addshore Date: Fri, 29 Aug 2014 13:38:33 +0100 Subject: [PATCH] Remove use of deprecated wfGetIP() Change-Id: I3de017317ea27ac816ffd7237724b1df439dff53 --- AJAXPoll_body.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/AJAXPoll_body.php b/AJAXPoll_body.php index ede2ed0..45cb1df 100644 --- a/AJAXPoll_body.php +++ b/AJAXPoll_body.php @@ -30,13 +30,13 @@ class AJAXPoll { # The callback function for converting the input text to HTML output static function AJAXPollRender( $input, $args = array(), Parser $parser, $frame ) { - global $wgUser, $wgScriptPath, $wgUseAjax; + global $wgUser, $wgRequest, $wgUseAjax; $parser->disableCache(); $parser->addTrackingCategory( 'ajaxpoll-tracking-category' ); if ( $wgUser->getName() == '' ) { - $userName = wfGetIP(); + $userName = $wgRequest->getIP(); } else { $userName = $wgUser->getName(); } @@ -186,13 +186,13 @@ During the last 48 hours, $tab2[0] votes have been given."; } public static function submitVote( $id, $answer, $token ) { - global $wgUser; + global $wgUser, $wgRequest; $dbw = wfGetDB( DB_MASTER ); $dbw->begin( __METHOD__ ); if ( $wgUser->getName() == '' ) { - $userName = wfGetIP(); + $userName = $wgRequest->getIP(); } else { $userName = $wgUser->getName(); } @@ -245,7 +245,7 @@ During the last 48 hours, $tab2[0] votes have been given."; array( 'poll_id' => $id, 'poll_user' => $userName, - 'poll_ip' => wfGetIP(), + 'poll_ip' => $wgRequest->getIP(), 'poll_answer' => $answer, 'poll_date' => wfTimestampNow() ),