Removing the Router::defineIP method.

This commit is contained in:
Ilya Bakhlin 2021-12-30 11:57:48 +01:00
parent 19bf47d799
commit bb6ffae04f

View file

@ -16,24 +16,6 @@ define("CHANDLER_ROOT", dirname(__FILE__) . "/..", false); // IMPROVE: Remove th
*/
class Bootstrap
{
/**
* Defines constant CONNECTING_IP, that stores end user's IP address.
* Uses X-Forwarded-For if present.
*
* @return void
* @internal
*/
private function defineIP(): void
{
if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
$path = explode(", ", $_SERVER["HTTP_X_FORWARDED_FOR"]);
$ip = $path[0];
} else {
$ip = $_SERVER["REMOTE_ADDR"];
}
define("CONNECTING_IP", $ip, false);
}
/**
* Bootstraps extensions.
*
@ -139,7 +121,6 @@ class Bootstrap
$this->igniteExtensions();
if (!$headless) {
header("Referrer-Policy: strict-origin-when-cross-origin");
$this->defineIP();
$this->route(function_exists("get_current_url") ? get_current_url() : $_SERVER["REQUEST_URI"]);
}
}