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
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 17:07:04 +0300
commita59dfd34771905d30b1183ce9dcf9d3846191d0e (patch)
tree953844bd5f2db62f86acdd7a793c5a4a1a30c595
parentfb96bb26b1b20a3c6f1701be1c872486fe81b267 (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)
-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'];
}
}