Refactored to use function, moved another function Signed-off-by: Kristian Feldsam <feldsam@gmail.com>
This commit is contained in:
@@ -2219,4 +2219,14 @@ function cleanupCSS($ignore = '', $folder = '/tmp/*.css') {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
function get_remote_ip() {
|
||||
$remote = $_SERVER['REMOTE_ADDR'];
|
||||
if (filter_var($remote, FILTER_VALIDATE_IP) === false) {
|
||||
return '0.0.0.0';
|
||||
}
|
||||
return $remote;
|
||||
}
|
||||
|
||||
function getEnvPort(string $name): int {
|
||||
return (int)filter_var(substr(getenv($name), strrpos(getenv($name), ':')), FILTER_SANITIZE_NUMBER_INT);
|
||||
}
|
Reference in New Issue
Block a user