From 8e125eb1680d60f0d6921b1f2aef77244eb8772a Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Fri, 30 Oct 2015 19:09:55 +0000 Subject: [PATCH] fixed IP check --- lam/lib/security.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lam/lib/security.inc b/lam/lib/security.inc index b5b441ca..00b9a273 100644 --- a/lam/lib/security.inc +++ b/lam/lib/security.inc @@ -116,7 +116,9 @@ function checkClientIP() { $allowedHosts = $cfg->allowedHostsSelfService; } // skip test if no hosts are defined - if ($allowedHosts == "") return; + if (empty($allowedHosts) || empty($_SERVER['REMOTE_ADDR'])) { + return; + } $allowedHosts = explode(",", $allowedHosts); $grantAccess = false; for ($i = 0; $i < sizeof($allowedHosts); $i++) {