Passed
Push — Security_and_bug_fixes ( e52d76...d45932 )
by Stone
08:57 queued 07:08
created
App/Controllers/Home.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
         $this->config = $this->siteConfig->getSiteConfig();
37 37
         $this->userModel = new UserModel($this->container);
38 38
         $this->postModel = new PostModel($this->container);
39
-        if($this->auth->isuser())
39
+        if ($this->auth->isuser())
40 40
         {
41
-            $this->data["user"] = $this->userModel->getUserDetailsById((int)$this->session->get("userId"));
41
+            $this->data["user"] = $this->userModel->getUserDetailsById((int) $this->session->get("userId"));
42 42
         }
43 43
     }
44 44
 
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
     private function testCapcha(string $gCapchaResponse):bool
51 51
     {
52 52
         $error = false;
53
-        if(Config::GOOGLE_RECAPCHA_PUBLIC_KEY !== "" && Config::GOOGLE_RECAPCHA_SECRET_KEY !== "")
53
+        if (Config::GOOGLE_RECAPCHA_PUBLIC_KEY !== "" && Config::GOOGLE_RECAPCHA_SECRET_KEY !== "")
54 54
         {
55
-            if(empty($gCapchaResponse))
55
+            if (empty($gCapchaResponse))
56 56
             {
57 57
                 $error = true;
58 58
                 $this->alertBox->setAlert('Capcha not set', 'error');
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             $grequest = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.Config::GOOGLE_RECAPCHA_SECRET_KEY.'&response='.$gCapchaResponse);
62 62
             // The result is in a JSON format. Decoding..
63 63
             $gresponse = json_decode($grequest);
64
-            if(!$gresponse->success)
64
+            if (!$gresponse->success)
65 65
             {
66 66
                 $error = true;
67 67
                 $this->alertBox->setAlert('Capcha Error', 'error');
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
         $capchaError = $this->testCapcha($message["g-recaptcha-response"]);
161 161
 
162
-        if($capchaError === true)
162
+        if ($capchaError === true)
163 163
         {
164 164
             $error = true;
165 165
         }
Please login to merge, or discard this patch.