Remove use of deprecated wfGetIP()

Change-Id: I3de017317ea27ac816ffd7237724b1df439dff53
This commit is contained in:
addshore 2014-08-29 13:38:33 +01:00
parent 32967f86ee
commit 7e65ec1e61

View file

@ -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()
),