@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | //Searching for the page break tag |
| 87 | 87 | $breakTagPosition = strpos($text, "<!-- EndOfExcerptBlogOc -->"); |
| 88 | - if($breakTagPosition > 0){ |
|
| 88 | + if ($breakTagPosition > 0) { |
|
| 89 | 89 | return $this->completeDom(substr($text, 0, $breakTagPosition)); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $string = preg_split('/(<img[^>]+\>)|(<p[^>]+\>)|(<span[^>]+\>)|\s/', $text, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); |
| 94 | 94 | |
| 95 | 95 | //The preg split can return false, probably will never happen but just in case. |
| 96 | - if(!$string) |
|
| 96 | + if (!$string) |
|
| 97 | 97 | { |
| 98 | 98 | throw new \Error("excerpt generation failed"); |
| 99 | 99 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $trimmed .= $string[$wordCounter]; |
| 107 | 107 | if ($wordCounter < $count - 1) { |
| 108 | 108 | $trimmed .= " "; |
| 109 | - } else { |
|
| 109 | + }else { |
|
| 110 | 110 | $trimmed .= "[...]"; |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $result = true; |
| 147 | 147 | foreach ($strings as $string) |
| 148 | 148 | { |
| 149 | - if(!$this->isAlphaNum($string)) |
|
| 149 | + if (!$this->isAlphaNum($string)) |
|
| 150 | 150 | { |
| 151 | 151 | $result = false; |
| 152 | 152 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | public function isHexa(string $string):bool |
| 163 | 163 | { |
| 164 | - return preg_match("/[\da-f]/",$string) === 1; |
|
| 164 | + return preg_match("/[\da-f]/", $string) === 1; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | //check if email is valid for sanity |
| 193 | 193 | if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { |
| 194 | 194 | $email = htmlspecialchars($email); |
| 195 | - throw new BlogocException("invalid email " . $email); |
|
| 195 | + throw new BlogocException("invalid email ".$email); |
|
| 196 | 196 | } |
| 197 | 197 | $sql = $this->baseSqlSelect(); |
| 198 | 198 | $sql .= " |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | $this->bind(':roles_idroles', 1); //we set to one, should probably get from database and config |
| 236 | 236 | $this->execute(); |
| 237 | 237 | |
| 238 | - return (int)$this->dbh->lastInsertId(); |
|
| 238 | + return (int) $this->dbh->lastInsertId(); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | */ |
| 246 | 246 | public function updateUser(\stdClass $user):void |
| 247 | 247 | { |
| 248 | - $sql=" |
|
| 248 | + $sql = " |
|
| 249 | 249 | UPDATE $this->userTbl |
| 250 | 250 | SET |
| 251 | 251 | name=:name, |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | if ($this->isAccountPasswordBlocked($user)) { |
| 299 | - $response->message = "too many bad passwords, account is blocked for " . Constant::LOCKOUT_MINUTES . " minutes"; |
|
| 299 | + $response->message = "too many bad passwords, account is blocked for ".Constant::LOCKOUT_MINUTES." minutes"; |
|
| 300 | 300 | return $response; |
| 301 | 301 | } |
| 302 | 302 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | private function populateUserFromId(int $userId) |
| 75 | 75 | { |
| 76 | 76 | $result = $this->userModel->getUserDetailsById($userId); |
| 77 | - $this->populateUser((array)$result); |
|
| 77 | + $this->populateUser((array) $result); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | //we are authenticated here |
| 198 | 198 | |
| 199 | 199 | //populate the user object with returned data |
| 200 | - $this->populateUser((array)$authUser->user); |
|
| 200 | + $this->populateUser((array) $authUser->user); |
|
| 201 | 201 | |
| 202 | 202 | //if the user wanted to be remembered |
| 203 | 203 | if ($rememberMe) { |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | |
| 226 | 226 | $register = $this->request->getDataFull(); |
| 227 | 227 | |
| 228 | - if($register === null) |
|
| 228 | + if ($register === null) |
|
| 229 | 229 | { |
| 230 | 230 | throw new \Exception("Error no data passed"); |
| 231 | 231 | } |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | $this->onlyAdmin(); |
| 26 | 26 | $this->onlyPost(); |
| 27 | - $state = (bool)($this->request->getData("state") === 'true'); |
|
| 28 | - $commentId = (int)$this->request->getData("commentId"); |
|
| 27 | + $state = (bool) ($this->request->getData("state") === 'true'); |
|
| 28 | + $commentId = (int) $this->request->getData("commentId"); |
|
| 29 | 29 | |
| 30 | 30 | $result = array(); |
| 31 | 31 | $result["success"] = $this->commentModel->setApproved(!$state, $commentId); |
@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | public function loadComments() |
| 38 | 38 | { |
| 39 | - $commentOffset = (int)$this->request->getData("commentOffset"); |
|
| 40 | - $postId = (int)$this->request->getData("postId"); |
|
| 39 | + $commentOffset = (int) $this->request->getData("commentOffset"); |
|
| 40 | + $postId = (int) $this->request->getData("postId"); |
|
| 41 | 41 | |
| 42 | 42 | $result = array(); |
| 43 | 43 | $result["success"] = false; |