From 5bdd75eb94fcd2becd70b47ee55d971a564e22c4 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 6 May 2017 23:02:12 -0400 Subject: [PATCH] Fix IP checking in API middleware, closes #425 --- app/Http/Middleware/HMACAuthorization.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Middleware/HMACAuthorization.php b/app/Http/Middleware/HMACAuthorization.php index eda4f8692..4f5c86f2b 100644 --- a/app/Http/Middleware/HMACAuthorization.php +++ b/app/Http/Middleware/HMACAuthorization.php @@ -148,7 +148,7 @@ class HMACAuthorization protected function validateIPAccess() { if (! is_null($this->key()->allowed_ips)) { - foreach ($this->key()->allowed_ips as $ip) { + foreach (json_decode($this->key()->allowed_ips) as $ip) { if (Range::parse($ip)->contains(new IP($this->request()->ip()))) { return true; }