Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorAndrejs Griščenko <andrejs.griscenko@zabbix.com>2022-11-07 17:03:56 +0300
committerAndrejs Griščenko <andrejs.griscenko@zabbix.com>2022-11-07 18:09:42 +0300
commit4d9b9a2abd5c198a5dadbcdd10c413b4c4f4acd5 (patch)
treec7dccbe54b57e23e9dacef37247503afbccd06c2 /ui
parentcd807e75dc1e3b06986acea2d117a813584ab1d8 (diff)
..F....... [DEV-2301] fixed spoofing X-Forwarded-For request header allows to access Frontend in maintenace mode
* commit '4cbc81c663b5e942d98750ca41e2f11b0eb9226e': ..F....... [DEV-2301] fixed spoofing X-Forwarded-For request header allows to access Frontend in maintenace mode (cherry picked from commit 50668e9d64af32cdc67a45082c556699ff86565e) (cherry picked from commit a59dfd34771905d30b1183ce9dcf9d3846191d0e) (cherry picked from commit 4d880f33f2264781b49c60ceecdf6dab7a1933a0)
Diffstat (limited to 'ui')
-rw-r--r--ui/include/classes/user/CWebUser.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/ui/include/classes/user/CWebUser.php b/ui/include/classes/user/CWebUser.php
index 7204f071b21..f25a14b3bd8 100644
--- a/ui/include/classes/user/CWebUser.php
+++ b/ui/include/classes/user/CWebUser.php
@@ -234,13 +234,11 @@ class CWebUser {
}
/**
- * Get user ip address.
+ * Get user IP address.
*
* @return string
*/
public static function getIp(): string {
- return (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && $_SERVER['HTTP_X_FORWARDED_FOR'] !== '')
- ? $_SERVER['HTTP_X_FORWARDED_FOR']
- : $_SERVER['REMOTE_ADDR'];
+ return $_SERVER['REMOTE_ADDR'];
}
}