@@ -211,10 +211,12 @@ |
||
| 211 | 211 | $this->alertBox->setAlert("empty slug not allowed", "error"); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - if ($postSlug != $originalPostSlug) //if the slug has been updated |
|
| 214 | + if ($postSlug != $originalPostSlug) { |
|
| 215 | + //if the slug has been updated |
|
| 215 | 216 | { |
| 216 | 217 | if (!$this->postModel->isPostSlugUnique($postSlug)) { |
| 217 | 218 | $error = true; |
| 219 | + } |
|
| 218 | 220 | $originalPostSlug = $this->postModel->getPostSlugFromId($postId); |
| 219 | 221 | $this->alertBox->setAlert("Slug not unique", "error"); |
| 220 | 222 | } |
@@ -204,9 +204,11 @@ |
||
| 204 | 204 | |
| 205 | 205 | $user = $this->getUserDetailsByEmail($email); |
| 206 | 206 | |
| 207 | - if ($user === false) //no user exists |
|
| 207 | + if ($user === false) { |
|
| 208 | + //no user exists |
|
| 208 | 209 | { |
| 209 | 210 | $response->message = "email doesn't exist, register a new account?"; |
| 211 | + } |
|
| 210 | 212 | return $response; |
| 211 | 213 | } |
| 212 | 214 | |
@@ -96,9 +96,11 @@ |
||
| 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>"; |
@@ -44,9 +44,11 @@ |
||
| 44 | 44 | |
| 45 | 45 | $data = $postModel->isPostSlugUnique(/** @scrutinizer ignore-type */$postSlug); //we have checked that slug is valid so no type error |
| 46 | 46 | |
| 47 | - if ($data === false) //slug is not unique, but could be from the same post |
|
| 47 | + if ($data === false) { |
|
| 48 | + //slug is not unique, but could be from the same post |
|
| 48 | 49 | { |
| 49 | 50 | $slugOfId = $postModel->getPostSlugFromId($postId); |
| 51 | + } |
|
| 50 | 52 | if ($slugOfId === $postSlug) { |
| 51 | 53 | //it's the same post, return true |
| 52 | 54 | $data = true; |
@@ -121,10 +121,12 @@ |
||
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | $refererUrl = $this->request->getReferer(); |
| 124 | - if($refererUrl === null) //referer can return null, set default |
|
| 124 | + if($refererUrl === null) { |
|
| 125 | + //referer can return null, set default |
|
| 125 | 126 | { |
| 126 | 127 | $refererUrl = "admin/comments/view-comments"; |
| 127 | 128 | } |
| 129 | + } |
|
| 128 | 130 | $baseUrl = $this->request->getBaseUrl(); |
| 129 | 131 | $redirectUrl = $this->removeFromBeginning($refererUrl, $baseUrl); |
| 130 | 132 | |