mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
Fixed broken get gethostbyaddr (#681)
This commit is contained in:
parent
78d19700f2
commit
bc6e8589a5
1 changed files with 6 additions and 1 deletions
|
@ -573,6 +573,8 @@ switch ($mode) {
|
|||
case 'ip':
|
||||
$anon = GUEST_UID;
|
||||
|
||||
$rdns_ip_num = (isset($_GET['rdns'])) ? $_GET['rdns'] : '';
|
||||
|
||||
if (!$post_id) {
|
||||
bb_die($lang['NO_SUCH_POST']);
|
||||
}
|
||||
|
@ -591,6 +593,8 @@ switch ($mode) {
|
|||
$ip_this_post = $lang['NOT_AVAILABLE'];
|
||||
}
|
||||
|
||||
$ip_this_post = ($rdns_ip_num == $ip_this_post) ? gethostbyaddr($ip_this_post) : $ip_this_post;
|
||||
|
||||
$poster_id = $post_row['poster_id'];
|
||||
|
||||
$template->assign_vars(array(
|
||||
|
@ -622,12 +626,13 @@ switch ($mode) {
|
|||
if (!$ip = \TorrentPier\Helpers\IPHelper::decodeIP($row['poster_ip'])) {
|
||||
$ip = $lang['NOT_AVAILABLE'];
|
||||
}
|
||||
$ip = ($rdns_ip_num == $ip || $rdns_ip_num == 'all') ? gethostbyaddr($ip) : $ip;
|
||||
|
||||
$template->assign_block_vars('iprow', array(
|
||||
'ROW_CLASS' => !($i % 2) ? 'row4' : 'row5',
|
||||
'IP' => $ip,
|
||||
'POSTS' => $row['postings'],
|
||||
'U_LOOKUP_IP' => "modcp.php?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=" . $row['poster_ip'] . "&sid=" . $userdata['session_id'],
|
||||
'U_LOOKUP_IP' => "modcp.php?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=" . $ip . "&sid=" . $userdata['session_id'],
|
||||
));
|
||||
|
||||
$i++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue