Passed
Push — Comments ( 971c2e...b89711 )
by Stone
02:58
created
App/Controllers/Post.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
         $this->onlyUser();
84 84
 
85 85
         //get the session userId
86
-        $userId = (int)$this->session->get("userId");
86
+        $userId = (int) $this->session->get("userId");
87 87
         $comment = $this->request->getData("newComment");
88
-        $postId = (int)$this->request->getData("postId");
88
+        $postId = (int) $this->request->getData("postId");
89 89
 
90 90
         //check if we are admin, Admins do not need moderation
91 91
         $admin = $this->session->get('user_role_level') >= Constant::ADMIN_LEVEL;
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
             $siteConfig = $this->siteConfig->getSiteConfig();
102 102
             $post = $this->postModel->getSinglePost($postId);
103 103
 
104
-            $emailMessage = "<h1>New comment on post " . $post->title . "</a></h1>";
105
-            $emailMessage .= "<p>Check it out <a href='" . $baseUrl . "admin/comments/moderate-comment/" . $commentId . "'>here</a> </p>";
104
+            $emailMessage = "<h1>New comment on post ".$post->title."</a></h1>";
105
+            $emailMessage .= "<p>Check it out <a href='".$baseUrl."admin/comments/moderate-comment/".$commentId."'>here</a> </p>";
106 106
 
107 107
             $this->sendMail->send($siteConfig["admin_email_address"], "New comment added", $emailMessage);
108 108
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,9 +96,11 @@
 block discarded – undo
96 96
         $baseUrl = $this->request->getBaseUrl();
97 97
         $redirectUrl = $this->removeFromBeginning($refererUrl, $baseUrl);
98 98
 
99
-        if (!$admin) //if we are not an admin, send an email to alert and add an alertBox
99
+        if (!$admin) {
100
+            //if we are not an admin, send an email to alert and add an alertBox
100 101
         {
101 102
             $siteConfig = $this->siteConfig->getSiteConfig();
103
+        }
102 104
             $post = $this->postModel->getSinglePost($postId);
103 105
 
104 106
             $emailMessage = "<h1>New comment on post " . $post->title . "</a></h1>";
Please login to merge, or discard this patch.