forked from Cavemanon/cavepaintings
format
This commit is contained in:
parent
476808db4b
commit
e97198aa10
|
@ -164,14 +164,16 @@ function check_im_version(): int
|
|||
* Get request IP
|
||||
*/
|
||||
|
||||
function get_remote_addr() {
|
||||
function get_remote_addr()
|
||||
{
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
/**
|
||||
* Get real IP if behind a reverse proxy
|
||||
*/
|
||||
|
||||
function get_real_ip() {
|
||||
function get_real_ip()
|
||||
{
|
||||
$ip = get_remote_addr();
|
||||
if (REVERSE_PROXY_X_HEADERS && isset($_SERVER['HTTP_X_REAL_IP'])) {
|
||||
$ip = $_SERVER['HTTP_X_REAL_IP'];
|
||||
|
@ -822,4 +824,3 @@ function generate_key(int $length = 20): string
|
|||
|
||||
return $randomString;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue