Passed
Push — Showing-Posts ( b80001...d80634 )
by Stone
02:09
created
Core/Traits/StringFunctions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
             $trimed .= $string[$wordCounter];
93 93
             if ($wordCounter < $count - 1) {
94 94
                 $trimed .= " ";
95
-            } else {
95
+            }else {
96 96
                 $trimed .= "[...]";
97 97
             }
98 98
         }
Please login to merge, or discard this patch.
App/Models/SlugModel.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
     {
22 22
 
23 23
         if (!$this->isAlphaNum($table)) {
24
-            throw new \ErrorException("Invalid table name " . $table);
24
+            throw new \ErrorException("Invalid table name ".$table);
25 25
         }
26 26
 
27 27
         if (!$this->isAlphaNum($columnName)) {
28
-            throw new \ErrorException("Invalid Column name " . $columnName);
28
+            throw new \ErrorException("Invalid Column name ".$columnName);
29 29
         }
30 30
 
31 31
         $slugTbl = $this->getTablePrefix($table);
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
     public function getIdFromSlug(string $slug, string $table, string $columnName, string $idColumn): int
50 50
     {
51 51
         if (!$this->isAlphaNum($table)) {
52
-            throw new \ErrorException("Invalid table name " . $table);
52
+            throw new \ErrorException("Invalid table name ".$table);
53 53
         }
54 54
 
55 55
         if (!$this->isAlphaNum($columnName)) {
56
-            throw new \ErrorException("Invalid Slug Column name " . $columnName);
56
+            throw new \ErrorException("Invalid Slug Column name ".$columnName);
57 57
         }
58 58
 
59 59
         if (!$this->isAlphaNum($idColumn)) {
60
-            throw new \ErrorException("Invalid ID Column name " . $columnName);
60
+            throw new \ErrorException("Invalid ID Column name ".$columnName);
61 61
         }
62 62
 
63 63
         $slugTbl = $this->getTablePrefix($table);
@@ -85,15 +85,15 @@  discard block
 block discarded – undo
85 85
     public function getSlugFromId(int $searchId, string $table, string $columnName, string $slugColumn): string
86 86
     {
87 87
         if (!$this->isAlphaNum($table)) {
88
-            throw new \ErrorException("Invalid table name " . $table);
88
+            throw new \ErrorException("Invalid table name ".$table);
89 89
         }
90 90
 
91 91
         if (!$this->isAlphaNum($columnName)) {
92
-            throw new \ErrorException("Invalid Slug Column name " . $columnName);
92
+            throw new \ErrorException("Invalid Slug Column name ".$columnName);
93 93
         }
94 94
 
95 95
         if (!$this->isAlphaNum($slugColumn)) {
96
-            throw new \ErrorException("Invalid ID Column name " . $columnName);
96
+            throw new \ErrorException("Invalid ID Column name ".$columnName);
97 97
         }
98 98
 
99 99
         $slugTbl = $this->getTablePrefix($table);
Please login to merge, or discard this patch.
App/Controllers/Admin/Post.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
         }
122 122
 
123 123
         if ($postId != null) {
124
-            $this->alertBox->setAlert("Post " . $title . " Created");
125
-            $this->container->getResponse()->redirect("admin/post/modify/" . $postSlug);
124
+            $this->alertBox->setAlert("Post ".$title." Created");
125
+            $this->container->getResponse()->redirect("admin/post/modify/".$postSlug);
126 126
         }
127
-        $this->alertBox->setAlert("Error creating " . $title, "error");
127
+        $this->alertBox->setAlert("Error creating ".$title, "error");
128 128
         $this->container->getResponse()->redirect("admin/post/new");
129 129
 
130 130
     }
@@ -204,11 +204,11 @@  discard block
 block discarded – undo
204 204
         }
205 205
 
206 206
         if ($postUpdate) {
207
-            $this->alertBox->setAlert("Post " . $title . " Updated");
208
-            $this->container->getResponse()->redirect("admin/post/modify/" . $postSlug);
207
+            $this->alertBox->setAlert("Post ".$title." Updated");
208
+            $this->container->getResponse()->redirect("admin/post/modify/".$postSlug);
209 209
         }
210
-        $this->alertBox->setAlert("Error updating " . $title, "error");
211
-        $this->container->getResponse()->redirect("admin/post/modify/" . $originalPostSlug);
210
+        $this->alertBox->setAlert("Error updating ".$title, "error");
211
+        $this->container->getResponse()->redirect("admin/post/modify/".$originalPostSlug);
212 212
 
213 213
     }
214 214
 }
215 215
\ 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
@@ -174,10 +174,12 @@
 block discarded – undo
174 174
             $this->alertBox->setAlert("empty slug not allowed", "error");
175 175
         }
176 176
 
177
-        if ($postSlug != $originalPostSlug) //if the slug has been updated
177
+        if ($postSlug != $originalPostSlug) {
178
+            //if the slug has been updated
178 179
         {
179 180
             if (!$slugModel->isUnique($postSlug, "posts", "posts_slug")) {
180 181
                 $error = true;
182
+        }
181 183
                 $originalPostSlug = $slugModel->getSlugFromId($postId, "posts", "idposts", "posts_slug");
182 184
                 $this->alertBox->setAlert("Slug not unique", "error");
183 185
             }
Please login to merge, or discard this patch.