From bb6ffae04fb04549b1ab720f2986499268f121c2 Mon Sep 17 00:00:00 2001 From: Ilya Bakhlin Date: Thu, 30 Dec 2021 11:57:48 +0100 Subject: [PATCH] Removing the Router::defineIP method. --- chandler/Bootstrap.php | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/chandler/Bootstrap.php b/chandler/Bootstrap.php index e405792..1926de2 100644 --- a/chandler/Bootstrap.php +++ b/chandler/Bootstrap.php @@ -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"]); } }