From a277c8fe87f0dbc7012b56c46205bbbd88c6d190 Mon Sep 17 00:00:00 2001
From: Dominik Pfennig <dominik@suma-ev.de>
Date: Thu, 3 May 2018 08:18:36 +0200
Subject: [PATCH] =?UTF-8?q?Schalter=20f=C3=BCr=20die=20Bot=20Protection=20?=
 =?UTF-8?q?in=20die=20Config=20eingebaut.=20Captcha=20wird=20nun=20auch=20?=
 =?UTF-8?q?korrekt=20angezeigt.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/Http/Middleware/HumanVerification.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/Http/Middleware/HumanVerification.php b/app/Http/Middleware/HumanVerification.php
index a04d55376..b4decd054 100644
--- a/app/Http/Middleware/HumanVerification.php
+++ b/app/Http/Middleware/HumanVerification.php
@@ -25,7 +25,7 @@ class HumanVerification
          * If someone that uses a bot finds this out we 
          * might have to change it at some point.
          */
-        if($request->filled('password') || $request->filled('key')){
+        if($request->filled('password') || $request->filled('key') || !env('BOT_PROTECTION', false)){
             return $next($request);
         }
 
@@ -39,7 +39,7 @@ class HumanVerification
                 ['id' => $id, 'unusedResultPages' => 1, 'locked' => false, 'updated_at' => now()]
             );
             $user = DB::table('humanverification')->where('id', $id)->first();
-        }else if($user->locked !== "1"){
+        }else if($user->locked !== 1){
             $unusedResultPages = intval($user->unusedResultPages);
             $unusedResultPages++;
             # We have different security gates:
@@ -55,7 +55,7 @@ class HumanVerification
 
 
         # If the user is locked we will force a Captcha validation
-        if($user->locked === "1"){
+        if($user->locked === 1){
             return redirect('meta/verification/' . $id . '/' . urlencode(base64_encode(url()->full())));
         }
 
-- 
GitLab