X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/0f8fa96f56dde46864336cd4864e158b55248f58..26d3657f83ba96b080c9cb0a242ee8b2d8fc1fe1:/lib/functions.php
diff --git a/lib/functions.php b/lib/functions.php
index 83fdaf1..592e841 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -623,7 +623,12 @@ jirafeau_admin_list ($name, $file_hash, $link_hash)
echo '
' . jirafeau_human_size ($l['file_size']) . ' | ';
echo '' . ($l['time'] == -1 ? '' : strftime ('%c', $l['time'])) .
' | ';
- echo '' . $l['onetime'] . ' | ';
+ echo '';
+ if ($l['onetime'] == 'O')
+ echo 'Y';
+ else
+ echo 'N';
+ echo ' | ';
echo '' . strftime ('%c', $l['upload_date']) . ' | ';
echo '' . $l['ip'] . ' | ';
echo '' .
@@ -1121,6 +1126,8 @@ get_ip_list_http_forwarded()
if (!empty ($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$l = explode (',', $_SERVER['HTTP_X_FORWARDED_FOR']);
+ if ($l === FALSE)
+ return array();
foreach ($l as $ip)
array_push ($ip_list, preg_replace ('/\s+/', '', $ip));
}
@@ -1130,7 +1137,10 @@ get_ip_list_http_forwarded()
foreach ($l as $ip)
{
// Separate IP from port
- $ip = explode (':', $ip)[0];
+ $ipa = explode (':', $ip);
+ if ($ipa === FALSE)
+ continue;
+ $ip = $ipa[0];
array_push ($ip_list, preg_replace ('/\s+/', '', $ip));
}
}
|