Passed
Push — Showing-Posts ( 75dad0...a59326 )
by Stone
01:51
created
App/Controllers/Admin/Post.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         $onFrontpage = $posts["isOnFrontPage"];
117 117
         $idUser = $userSessionId;
118 118
 
119
-        if(!is_int($idUser) || $idUser === null)
119
+        if (!is_int($idUser) || $idUser === null)
120 120
         {
121 121
             throw new \Error("Invalid userID");
122 122
         }
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
 
151 151
         //checking result and redirecting
152 152
         if ($postId != null) {
153
-            $this->alertBox->setAlert("Post " . $title . " Created");
154
-            $this->container->getResponse()->redirect("admin/post/modify/" . $postSlug);
153
+            $this->alertBox->setAlert("Post ".$title." Created");
154
+            $this->container->getResponse()->redirect("admin/post/modify/".$postSlug);
155 155
         }
156
-        $this->alertBox->setAlert("Error creating " . $title, "error");
156
+        $this->alertBox->setAlert("Error creating ".$title, "error");
157 157
         $this->container->getResponse()->redirect("admin/post/new");
158 158
 
159 159
     }
@@ -222,10 +222,10 @@  discard block
 block discarded – undo
222 222
 
223 223
         //checking result and redirecting
224 224
         if ($postUpdate) {
225
-            $this->alertBox->setAlert("Post " . $title . " Updated");
226
-            $this->container->getResponse()->redirect("admin/post/modify/" . $postSlug);
225
+            $this->alertBox->setAlert("Post ".$title." Updated");
226
+            $this->container->getResponse()->redirect("admin/post/modify/".$postSlug);
227 227
         }
228
-        $this->alertBox->setAlert("Error updating " . $title, "error");
229
-        $this->container->getResponse()->redirect("admin/post/modify/" . $originalPostSlug);
228
+        $this->alertBox->setAlert("Error updating ".$title, "error");
229
+        $this->container->getResponse()->redirect("admin/post/modify/".$originalPostSlug);
230 230
     }
231 231
 }
232 232
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -196,10 +196,12 @@
 block discarded – undo
196 196
             $this->alertBox->setAlert("empty slug not allowed", "error");
197 197
         }
198 198
 
199
-        if ($postSlug != $originalPostSlug) //if the slug has been updated
199
+        if ($postSlug != $originalPostSlug) {
200
+            //if the slug has been updated
200 201
         {
201 202
             if (!$this->slugModel->isUnique($postSlug, "posts", "posts_slug")) {
202 203
                 $error = true;
204
+        }
203 205
                 $originalPostSlug = $this->slugModel->getSlugFromId($postId, "posts", "idposts", "posts_slug");
204 206
                 $this->alertBox->setAlert("Slug not unique", "error");
205 207
             }
Please login to merge, or discard this patch.