Completed
Pull Request — master (#7)
by Lars
06:09
created
app/Http/Middleware/SecureCommentInputMiddleware.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 
35 35
         if ($method == "POST" && $requestPath == "/api/comment/add") {
36 36
             if ($spam != null) {
37
-                $returnArray["error-code"] = "bot-detected";
37
+                $returnArray[ "error-code" ] = "bot-detected";
38 38
                 $returnStatus = 403;
39 39
             } else if ($captcha == null) {
40
-                $returnArray["error-code"] = "captcha-missing";
40
+                $returnArray[ "error-code" ] = "captcha-missing";
41 41
                 $returnStatus = 400;
42 42
             } else if ($captcha != getenv("CAPTCHA_SECRET")) {
43
-                $returnArray["error-code"] = "captcha-wrong";
43
+                $returnArray[ "error-code" ] = "captcha-wrong";
44 44
                 $returnStatus = 400;
45 45
             } else {
46 46
                 $blogHash = $request->input("blogHash");
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
                 $articleUrl = $request->input("articleUrl");
53 53
 
54 54
                 if ($blogHash == null || $articleHash == null || $articleTitle == null || $articleAuthor == null || $articleUrl == null || $authorName == null || $content == null) {
55
-                    $returnArray["error-code"] = "invalid-request";
55
+                    $returnArray[ "error-code" ] = "invalid-request";
56 56
                     $returnStatus = 400;
57 57
                 } else if ($blogResult == null) {
58
-                    $returnArray["error-code"] = "blog-not-found";
58
+                    $returnArray[ "error-code" ] = "blog-not-found";
59 59
                     $returnStatus = 404;
60 60
                 }
61 61
             }
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
             $hash = $request->input("hash");
64 64
             $commentResult = $comment->where("hash", $hash)->first();
65 65
             if ($commentResult == null) {
66
-                $returnArray["error-code"] = "comment-not-found";
66
+                $returnArray[ "error-code" ] = "comment-not-found";
67 67
                 $returnStatus = 404;
68 68
             }
69 69
         } else {
70
-            $returnArray["error-code"] = "request-not-found";
70
+            $returnArray[ "error-code" ] = "request-not-found";
71 71
             $returnStatus = 400;
72 72
         }
73 73
 
Please login to merge, or discard this patch.