mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Merge pull request #698 from wrongecho/fix-braces
Functions.php - IP checker - braces
This commit is contained in:
@@ -85,9 +85,10 @@ function getIP() {
|
|||||||
} else {
|
} else {
|
||||||
$ip = $_SERVER["HTTP_CF_CONNECTING_IP"] ?? $_SERVER['REMOTE_ADDR'];
|
$ip = $_SERVER["HTTP_CF_CONNECTING_IP"] ?? $_SERVER['REMOTE_ADDR'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!filter_var($ip, FILTER_VALIDATE_IP))
|
if (!filter_var($ip, FILTER_VALIDATE_IP)) {
|
||||||
die("Potential Security Violation");
|
exit("Potential Security Violation");
|
||||||
|
}
|
||||||
|
|
||||||
return $ip;
|
return $ip;
|
||||||
}
|
}
|
||||||
@@ -657,7 +658,7 @@ function sanitizeForEmail($data) {
|
|||||||
function timeAgo($datetime) {
|
function timeAgo($datetime) {
|
||||||
$time = strtotime($datetime);
|
$time = strtotime($datetime);
|
||||||
$difference = time() - $time;
|
$difference = time() - $time;
|
||||||
|
|
||||||
if ($difference < 1) {
|
if ($difference < 1) {
|
||||||
return 'just now';
|
return 'just now';
|
||||||
}
|
}
|
||||||
@@ -670,7 +671,7 @@ function timeAgo($datetime) {
|
|||||||
60 => 'minute',
|
60 => 'minute',
|
||||||
1 => 'second'
|
1 => 'second'
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($timeRules as $secs => $str) {
|
foreach ($timeRules as $secs => $str) {
|
||||||
$div = $difference / $secs;
|
$div = $difference / $secs;
|
||||||
if ($div >= 1) {
|
if ($div >= 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user