From 2dafdedfe29aee7ed19d141bbe0953e94b4a499b Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sun, 22 Nov 2015 21:56:53 +0000 Subject: Various code cleanups --- index.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index e00f42a..dd34a1c 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,5 @@ Sign out'; @@ -19,8 +19,8 @@ if (isset($_GET) && count($_GET) > 0) { if (isset($_GET['signout'])) { if (isset($_COOKIE['password'])) { unset($_COOKIE['password']); - setcookie('password', null, -1, '/', $_SERVER['SERVER_NAME']); - header('Location: ' . $url); + setcookie("password", null, -1, "/", $_SERVER['SERVER_NAME']); + header("Location: " . $url); } } @@ -28,14 +28,14 @@ if ($_POST && $pass) { if ((hash("sha256", $_POST['password']) == $pass)) { if (isset($_POST['rememberme'])) { /* Set cookie to last 1 year */ - setcookie('password', hash("sha256", $_POST['password']), time()+60*60*24*365, '/', $_SERVER['SERVER_NAME'] ); + setcookie("password", hash("sha256", $_POST['password']), time()+60*60*24*365, "/", $_SERVER['SERVER_NAME'] ); } else { /* Cookie expires when browser closes */ - setcookie('password', hash("sha256", $_POST['password']), false, '/', $_SERVER['SERVER_NAME'] ); + setcookie("password", hash("sha256", $_POST['password']), false, "/", $_SERVER['SERVER_NAME'] ); } - header('Location: ' . $url . $getstring); + header("Location: " . $url . $getstring); } else { - header('Location: ' . $url); + header("Location: " . $url); exit(); } } else if ($pass) { @@ -46,7 +46,7 @@ if ($_POST && $pass) { <?php echo $logontitle ?> @@ -67,7 +67,7 @@ if ($_POST && $pass) { $signout = ""; } -function size_readable($size, $max = null, $system = 'si', $retstring = '%01.2f %s') { +function size_readable($size, $max = null, $system = "si", $retstring = "%01.2f %s") { // Pick units $systems['si']['prefix'] = array('B', 'K', 'MB', 'GB', 'TB', 'PB'); $systems['si']['size'] = 1000; @@ -200,7 +200,7 @@ while ($this_array = each($ordered_array)) { } } - $fileparts = explode('.', strtolower($value)); + $fileparts = explode(".", strtolower($value)); $icon = "unknown"; switch ($fileparts[count($fileparts)-1]) { @@ -297,7 +297,7 @@ while ($this_array = each($ordered_array)) { $icon="unknown"; break; } - + $listing[$listsize]['filename'] = utf8_encode($value); $listing[$listsize]['type'] = $icon; $listing[$listsize]['modified'] = $key; @@ -337,7 +337,7 @@ for ($i = 0; $i < count($listing); $i++) { $spaces = $spaces . " "; } - echo '[IMG] ' . $preview . '' . $spaces . date("d-M-Y H:i", $listing[$i]['modified']) . ' ' . size_readable($listing[$i]['size'], null, "bi") . ' ' . "\n"; + echo '[IMG] ' . $preview . "" . $spaces . date("d-M-Y H:i", $listing[$i]['modified']) . " " . size_readable($listing[$i]['size'], null, "bi") . " " . "\n"; } ?>
-- cgit v1.2.3