@@ -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 | |