mirror of
https://github.com/openvk/chandler.git
synced 2025-03-31 21:43:59 +03:00
Removing the Router::defineIP method.
This commit is contained in:
parent
19bf47d799
commit
bb6ffae04f
1 changed files with 0 additions and 19 deletions
|
@ -16,24 +16,6 @@ define("CHANDLER_ROOT", dirname(__FILE__) . "/..", false); // IMPROVE: Remove th
|
||||||
*/
|
*/
|
||||||
class Bootstrap
|
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.
|
* Bootstraps extensions.
|
||||||
*
|
*
|
||||||
|
@ -139,7 +121,6 @@ class Bootstrap
|
||||||
$this->igniteExtensions();
|
$this->igniteExtensions();
|
||||||
if (!$headless) {
|
if (!$headless) {
|
||||||
header("Referrer-Policy: strict-origin-when-cross-origin");
|
header("Referrer-Policy: strict-origin-when-cross-origin");
|
||||||
$this->defineIP();
|
|
||||||
$this->route(function_exists("get_current_url") ? get_current_url() : $_SERVER["REQUEST_URI"]);
|
$this->route(function_exists("get_current_url") ? get_current_url() : $_SERVER["REQUEST_URI"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue