diff --git a/common.php b/common.php index abec3b3b..70af11bb 100644 --- a/common.php +++ b/common.php @@ -41,7 +41,7 @@ date_default_timezone_set('UTC'); $allowed_cdn = array('HTTP_X_FORWARDED_FOR', 'HTTP_FASTLY_CLIENT_IP', 'HTTP_CF_CONNECTING_IP'); foreach ($allowed_cdn as $cdn) { - if (isset($_SERVER[$cdn]) && filter_var($_SERVER[$cdn], FILTER_VALIDATE_IP)) + if (isset($_SERVER[$cdn]) && filter_var($_SERVER[$cdn], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { $_SERVER['REMOTE_ADDR'] = $_SERVER[$cdn]; } diff --git a/library/attach_mod/displaying_torrent.php b/library/attach_mod/displaying_torrent.php index b6e3a2a3..67dc89ce 100644 --- a/library/attach_mod/displaying_torrent.php +++ b/library/attach_mod/displaying_torrent.php @@ -236,7 +236,7 @@ if ($tor_reged && $tor_info) 'DOWNLOAD_COUNT' => declension((int)$download_count, 'times'), 'REGED_TIME' => bb_date($tor_info['reg_time']), 'REGED_DELTA' => delta_time($tor_info['reg_time']), - 'TORRENT_SIZE' => humn_size($tor_size), + 'TORRENT_SIZE' => humn_size($tor_size, 2), 'COMPLETED' => $show_completed_count ? declension((int)$tor_info['complete_count'], 'times') : false, )); @@ -252,7 +252,7 @@ if ($tor_reged && $tor_info) 'SHOW_DL_LIST' => true, 'SHOW_DL_LIST_TOR_INFO' => true, - 'TOR_SIZE' => humn_size($tor_size), + 'TOR_SIZE' => humn_size($tor_size, 1), 'TOR_LONGEVITY' => delta_time($tor_info['reg_time']), 'TOR_COMPLETED' => $show_completed_count ? declension((int)$tor_info['complete_count'], 'times') : false, 'TOR_DOWNLOAD_COUNT' => declension((int)$download_count, 'times'), diff --git a/tracker.php b/tracker.php index 71bf4eb5..b4c1787c 100644 --- a/tracker.php +++ b/tracker.php @@ -831,7 +831,7 @@ if ($allowed_forums) 'TOR_STATUS_TEXT' => $lang['TOR_STATUS_NAME'][$tor['tor_status']], 'TOR_SIZE_RAW' => $size, - 'TOR_SIZE' => humn_size($size), + 'TOR_SIZE' => humn_size($size, 1), 'UL_SPEED' => $ul_sp, 'DL_SPEED' => $dl_sp, 'SEEDS' => ($seeds) ? $seeds : 0, diff --git a/viewforum.php b/viewforum.php index 575261ae..86dd1ceb 100644 --- a/viewforum.php +++ b/viewforum.php @@ -521,7 +521,7 @@ foreach ($topic_rowset as $topic) $template->assign_block_vars('t.tor', array( 'SEEDERS' => (int) $topic['seeders'], 'LEECHERS' => (int) $topic['leechers'], - 'TOR_SIZE' => humn_size($topic['tor_size']), + 'TOR_SIZE' => humn_size($topic['tor_size'], 1), 'COMPL_CNT' => $show_completed_count ? (int) $topic['complete_count'] : (int) $topic['download_count'], 'SHOW_COMPL' => (bool) $show_completed_count, 'ATTACH_ID' => $topic['attach_id'],