Fix #1468 inconsistent use of REMOTE_ADDR vs. RX_CLIENT_IP

This commit is contained in:
Kijin Sung 2020-11-18 00:17:49 +09:00
parent 996ca166e8
commit 2d6a175b19
11 changed files with 24 additions and 32 deletions

View file

@ -171,7 +171,7 @@ class commentController extends comment
}
else
{
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
$args->ipaddress = \RX_CLIENT_IP;
}
$output = executeQuery('comment.getCommentVotedLogInfo', $args);
if(!$output->data->count)
@ -1439,7 +1439,7 @@ class commentController extends comment
$oComment = CommentModel::getComment($comment_srl, FALSE, FALSE);
// Pass if the author's IP address is as same as visitor's.
if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
if($oComment->get('ipaddress') == \RX_CLIENT_IP)
{
$_SESSION['voted_comment'][$comment_srl] = false;
return new BaseObject(-1, $failed_voted);
@ -1467,7 +1467,7 @@ class commentController extends comment
}
else
{
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
$args->ipaddress = \RX_CLIENT_IP;
}
$args->comment_srl = $comment_srl;
$output = executeQuery('comment.getCommentVotedLogInfo', $args);
@ -1582,7 +1582,7 @@ class commentController extends comment
$oComment = CommentModel::getComment($comment_srl, FALSE, FALSE);
// failed if both ip addresses between author's and the current user are same.
if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
if($oComment->get('ipaddress') == \RX_CLIENT_IP)
{
$_SESSION['declared_comment'][$comment_srl] = TRUE;
return new BaseObject(-1, 'failed_declared');