IP storage and attachment system bugfix. PHP 5.6+.

This commit is contained in:
Yuriy Pikhtarev 2017-06-12 03:31:39 +03:00
commit 8c6097f5d8
No known key found for this signature in database
GPG key ID: 3A9B5A757B48ECC6
14 changed files with 74 additions and 123 deletions

View file

@ -591,8 +591,6 @@ switch ($mode) {
case 'ip':
$anon = GUEST_UID;
$rdns_ip_num = (isset($_GET['rdns'])) ? $_GET['rdns'] : "";
if (!$post_id) {
bb_die($lang['NO_SUCH_POST']);
}
@ -607,8 +605,9 @@ switch ($mode) {
bb_die($lang['NO_SUCH_POST']);
}
$ip_this_post = decode_ip($post_row['poster_ip']);
$ip_this_post = ($rdns_ip_num == $ip_this_post) ? gethostbyaddr($ip_this_post) : $ip_this_post;
if (!$ip_this_post = decode_ip($post_row['poster_ip'])) {
$ip_this_post = $lang['NOT_AVAILABLE'];
}
$poster_id = $post_row['poster_id'];
@ -638,8 +637,9 @@ switch ($mode) {
continue;
}
$ip = decode_ip($row['poster_ip']);
$ip = ($rdns_ip_num == $row['poster_ip'] || $rdns_ip_num == 'all') ? gethostbyaddr($ip) : $ip;
if (!$ip = decode_ip($row['poster_ip'])) {
$ip = $lang['NOT_AVAILABLE'];
}
$template->assign_block_vars('iprow', array(
'ROW_CLASS' => !($i % 2) ? 'row4' : 'row5',