From 98955ece12ada5aead6477f0b5f49958fdc3462f Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 14 Jun 2023 20:54:06 +0700 Subject: [PATCH] Minor improvements (#175) --- library/ajax/mod_action.php | 4 ++-- modcp.php | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/library/ajax/mod_action.php b/library/ajax/mod_action.php index b4f21a1f..0446be60 100644 --- a/library/ajax/mod_action.php +++ b/library/ajax/mod_action.php @@ -73,13 +73,13 @@ switch ($mode) $reg_ip = DB()->fetch_rowset("SELECT username, user_id, user_rank FROM ". BB_USERS ." WHERE user_reg_ip = '{$profiledata['user_reg_ip']}' - AND user_reg_ip != '' + AND user_reg_ip != 0 AND user_id != {$profiledata['user_id']} ORDER BY username ASC"); $last_ip = DB()->fetch_rowset("SELECT username, user_id, user_rank FROM " .BB_USERS ." WHERE user_last_ip = '{$profiledata['user_last_ip']}' - AND user_last_ip != '' + AND user_last_ip != 0 AND user_id != {$profiledata['user_id']}"); $link_reg_ip = $link_last_ip = ''; diff --git a/modcp.php b/modcp.php index d459186b..65870575 100644 --- a/modcp.php +++ b/modcp.php @@ -673,7 +673,10 @@ switch ($mode) bb_die($lang['NO_SUCH_POST']); } - $ip_this_post = decode_ip($post_row['poster_ip']); + if (!$ip_this_post = decode_ip($post_row['poster_ip'])) + { + $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']; @@ -708,7 +711,10 @@ switch ($mode) continue; } - $ip = decode_ip($row['poster_ip']); + if (!$ip = decode_ip($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( @@ -850,4 +856,4 @@ require(PAGE_HEADER); $template->pparse('body'); -require(PAGE_FOOTER); \ No newline at end of file +require(PAGE_FOOTER);