From 2c53faddd489069cc69bbab0154a44fa3fe3fa1b Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Tue, 13 Jun 2023 20:36:32 +0100 Subject: [PATCH] Add curly braces around if statement, adjust to exit for consistency --- functions.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/functions.php b/functions.php index 3ea2722b..325e2cc4 100644 --- a/functions.php +++ b/functions.php @@ -85,9 +85,10 @@ function getIP() { } else { $ip = $_SERVER["HTTP_CF_CONNECTING_IP"] ?? $_SERVER['REMOTE_ADDR']; } - - if (!filter_var($ip, FILTER_VALIDATE_IP)) - die("Potential Security Violation"); + + if (!filter_var($ip, FILTER_VALIDATE_IP)) { + exit("Potential Security Violation"); + } return $ip; } @@ -657,7 +658,7 @@ function sanitizeForEmail($data) { function timeAgo($datetime) { $time = strtotime($datetime); $difference = time() - $time; - + if ($difference < 1) { return 'just now'; } @@ -670,7 +671,7 @@ function timeAgo($datetime) { 60 => 'minute', 1 => 'second' ); - + foreach ($timeRules as $secs => $str) { $div = $difference / $secs; if ($div >= 1) {