From 09dd79dbc72895a9be4a94dc8852c29868f9f5f7 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Tue, 22 Dec 2015 20:58:23 +0100 Subject: [PATCH] switching to SHA256 HMAC of IPs in traffic limiter, resolves #57 --- lib/trafficlimiter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/trafficlimiter.php b/lib/trafficlimiter.php index 2af99d73..597861d6 100644 --- a/lib/trafficlimiter.php +++ b/lib/trafficlimiter.php @@ -79,7 +79,7 @@ class trafficlimiter extends persistence */ public static function getIp() { - return md5($_SERVER[self::$_ipKey]); + return $_SERVER[self::$_ipKey]; } /** @@ -94,11 +94,11 @@ class trafficlimiter extends persistence */ public static function canPass() { - $ip = self::getIp(); - // disable limits if set to less then 1 if (self::$_limit < 1) return true; + $ip = hash_hmac('sha256', self::getIp(), serversalt::get()); + $file = 'traffic_limiter.php'; if (!self::_exists($file)) {