Visman пре 4 година
родитељ
комит
1056711792
44 измењених фајлова са 95 додато и 85 уклоњено
  1. 5 5
      app/Core/DB/mysql.php
  2. 1 1
      app/Models/BanList/Delete.php
  3. 1 1
      app/Models/BanList/GetList.php
  4. 3 3
      app/Models/Categories/Manager.php
  5. 3 3
      app/Models/Censorship/Save.php
  6. 3 1
      app/Models/Forum/CalcStat.php
  7. 1 1
      app/Models/Forum/Delete.php
  8. 1 1
      app/Models/Forum/LoadTree.php
  9. 2 2
      app/Models/Forum/Markread.php
  10. 1 1
      app/Models/Forum/Model.php
  11. 2 2
      app/Models/Forum/Refresh.php
  12. 1 1
      app/Models/Forum/Save.php
  13. 1 1
      app/Models/Group/Delete.php
  14. 5 5
      app/Models/Group/Perm.php
  15. 2 2
      app/Models/Online/Model.php
  16. 3 3
      app/Models/Pages/Admin/Update.php
  17. 1 1
      app/Models/Poll/Delete.php
  18. 1 1
      app/Models/Poll/Load.php
  19. 3 3
      app/Models/Post/Feed.php
  20. 2 2
      app/Models/Post/Load.php
  21. 1 1
      app/Models/Post/PreviousPost.php
  22. 1 1
      app/Models/Post/RebuildIndex.php
  23. 1 1
      app/Models/Post/UserInfoFromIP.php
  24. 1 1
      app/Models/Post/UserStat.php
  25. 1 1
      app/Models/Post/View.php
  26. 1 1
      app/Models/Report/Load.php
  27. 1 1
      app/Models/Report/Manager.php
  28. 4 4
      app/Models/Search/Delete.php
  29. 2 2
      app/Models/Search/Execute.php
  30. 4 4
      app/Models/Search/Index.php
  31. 1 1
      app/Models/Topic/Access.php
  32. 1 1
      app/Models/Topic/CalcStat.php
  33. 2 2
      app/Models/Topic/Load.php
  34. 3 3
      app/Models/Topic/Merge.php
  35. 6 6
      app/Models/Topic/Model.php
  36. 1 1
      app/Models/Topic/View.php
  37. 1 1
      app/Models/User/AdminsIds.php
  38. 1 1
      app/Models/User/ChangeGroup.php
  39. 1 1
      app/Models/User/IsUniqueName.php
  40. 12 4
      app/Models/User/Load.php
  41. 2 2
      app/Models/User/Promote.php
  42. 1 1
      app/Models/User/UpdateLastVisit.php
  43. 1 1
      app/Models/User/UsersNumber.php
  44. 3 3
      app/config/defaultBBCode.php

+ 5 - 5
app/Core/DB/mysql.php

@@ -129,7 +129,7 @@ class Mysql
         $table = ($noPrefix ? '' : $this->dbPrefix) . $table;
         $table = ($noPrefix ? '' : $this->dbPrefix) . $table;
 
 
         try {
         try {
-            $vars  = [
+            $vars = [
                 ':table' => $table,
                 ':table' => $table,
             ];
             ];
             $query = 'SELECT 1
             $query = 'SELECT 1
@@ -154,7 +154,7 @@ class Mysql
         $table = ($noPrefix ? '' : $this->dbPrefix) . $table;
         $table = ($noPrefix ? '' : $this->dbPrefix) . $table;
 
 
         try {
         try {
-            $vars  = [
+            $vars = [
                 ':table' => $table,
                 ':table' => $table,
                 ':field' => $field,
                 ':field' => $field,
             ];
             ];
@@ -181,7 +181,7 @@ class Mysql
         $index = 'PRIMARY' == $index ? $index : $table . '_' . $index;
         $index = 'PRIMARY' == $index ? $index : $table . '_' . $index;
 
 
         try {
         try {
-            $vars  = [
+            $vars = [
                 ':table' => $table,
                 ':table' => $table,
                 ':index' => $index,
                 ':index' => $index,
             ];
             ];
@@ -408,7 +408,7 @@ class Mysql
         $table = ($noPrefix ? '' : $this->dbPrefix) . $table;
         $table = ($noPrefix ? '' : $this->dbPrefix) . $table;
 
 
         try {
         try {
-            $vars  = [
+            $vars = [
                 ':table' => $table,
                 ':table' => $table,
                 ':field' => $old,
                 ':field' => $old,
             ];
             ];
@@ -557,7 +557,7 @@ class Mysql
      */
      */
     public function getMap(): array
     public function getMap(): array
     {
     {
-        $vars  = [
+        $vars = [
             "{$this->dbPrefix}%",
             "{$this->dbPrefix}%",
         ];
         ];
         $query = 'SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE
         $query = 'SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE

+ 1 - 1
app/Models/BanList/Delete.php

@@ -16,7 +16,7 @@ class Delete extends Method
     public function delete(int ...$ids): BanList
     public function delete(int ...$ids): BanList
     {
     {
         if (! empty($ids)) {
         if (! empty($ids)) {
-            $vars  = [
+            $vars = [
                 ':ids' => $ids,
                 ':ids' => $ids,
             ];
             ];
             $query = 'DELETE
             $query = 'DELETE

+ 1 - 1
app/Models/BanList/GetList.php

@@ -13,7 +13,7 @@ class GetList extends Method
      */
      */
     public function getList(array $ids): array
     public function getList(array $ids): array
     {
     {
-        $vars  = [
+        $vars = [
             ':ids' => $ids,
             ':ids' => $ids,
         ];
         ];
         $query = 'SELECT b.id, b.username, b.ip, b.email, b.message, b.expire, u.id AS id_creator, u.username AS name_creator
         $query = 'SELECT b.id, b.username, b.ip, b.email, b.message, b.expire, u.id AS id_creator, u.username AS name_creator

+ 3 - 3
app/Models/Categories/Manager.php

@@ -61,7 +61,7 @@ class Manager extends ManagerModel
     {
     {
         foreach ($this->modified as $key => $value) {
         foreach ($this->modified as $key => $value) {
             $cat   = $this->get($key);
             $cat   = $this->get($key);
-            $vars  = [
+            $vars = [
                 ':name'     => $cat['cat_name'],
                 ':name'     => $cat['cat_name'],
                 ':position' => $cat['disp_position'],
                 ':position' => $cat['disp_position'],
                 ':cid'      => $key,
                 ':cid'      => $key,
@@ -87,7 +87,7 @@ class Manager extends ManagerModel
         }
         }
         ++$pos;
         ++$pos;
 
 
-        $vars  = [
+        $vars = [
             ':name'     => $name,
             ':name'     => $name,
             ':position' => $pos,
             ':position' => $pos,
         ];
         ];
@@ -116,7 +116,7 @@ class Manager extends ManagerModel
             $this->c->forums->delete(...$del);
             $this->c->forums->delete(...$del);
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':cid' => $cid,
             ':cid' => $cid,
         ];
         ];
         $query = 'DELETE
         $query = 'DELETE

+ 3 - 3
app/Models/Censorship/Save.php

@@ -31,7 +31,7 @@ class Save extends Method
                     $list[$id]['search_for'] !== $words[$id]['search_for']
                     $list[$id]['search_for'] !== $words[$id]['search_for']
                     || $list[$id]['replace_with'] !== $words[$id]['replace_with']
                     || $list[$id]['replace_with'] !== $words[$id]['replace_with']
                 ) {
                 ) {
-                    $vars  = [
+                    $vars = [
                         ':id'      => $id,
                         ':id'      => $id,
                         ':search'  => $list[$id]['search_for'],
                         ':search'  => $list[$id]['search_for'],
                         ':replace' => $list[$id]['replace_with'],
                         ':replace' => $list[$id]['replace_with'],
@@ -43,7 +43,7 @@ class Save extends Method
                     $this->c->DB->exec($query, $vars);
                     $this->c->DB->exec($query, $vars);
                 }
                 }
             } elseif (0 === $id) {
             } elseif (0 === $id) {
-                $vars  = [
+                $vars = [
                     ':search'  => $list[$id]['search_for'],
                     ':search'  => $list[$id]['search_for'],
                     ':replace' => $list[$id]['replace_with'],
                     ':replace' => $list[$id]['replace_with'],
                 ];
                 ];
@@ -54,7 +54,7 @@ class Save extends Method
             }
             }
         }
         }
         if ($forDel) {
         if ($forDel) {
-            $vars  = [
+            $vars = [
                 ':del' => $forDel
                 ':del' => $forDel
             ];
             ];
             $query = 'DELETE
             $query = 'DELETE

+ 3 - 1
app/Models/Forum/CalcStat.php

@@ -19,7 +19,9 @@ class CalcStat extends Method
             throw new RuntimeException('The model does not have ID');
             throw new RuntimeException('The model does not have ID');
         }
         }
 
 
-        $vars  = [':fid' => $this->model->id];
+        $vars = [
+            ':fid' => $this->model->id,
+        ];
         $query = 'SELECT COUNT(t.id)
         $query = 'SELECT COUNT(t.id)
             FROM ::topics AS t
             FROM ::topics AS t
             WHERE t.forum_id=?i:fid AND t.moved_to!=0';
             WHERE t.forum_id=?i:fid AND t.moved_to!=0';

+ 1 - 1
app/Models/Forum/Delete.php

@@ -35,7 +35,7 @@ class Delete extends Action
                 }
                 }
 
 
                 $uids[$arg->id] = $arg->id;
                 $uids[$arg->id] = $arg->id;
-                $isUser            = 1;
+                $isUser         = 1;
             } elseif ($arg instanceof Forum) {
             } elseif ($arg instanceof Forum) {
                 if (! $this->c->forums->get($arg->id) instanceof Forum) {
                 if (! $this->c->forums->get($arg->id) instanceof Forum) {
                     throw new RuntimeException('Forum unavailable');
                     throw new RuntimeException('Forum unavailable');

+ 1 - 1
app/Models/Forum/LoadTree.php

@@ -107,7 +107,7 @@ class LoadTree extends Action
         }
         }
 
 
         // проверка по темам
         // проверка по темам
-        $vars  = [
+        $vars = [
             ':uid'    => $this->c->user->id,
             ':uid'    => $this->c->user->id,
             ':forums' => \array_keys($time),
             ':forums' => \array_keys($time),
             ':max'    => $max,
             ':max'    => $max,

+ 2 - 2
app/Models/Forum/Markread.php

@@ -25,7 +25,7 @@ class Markread extends Action
 
 
             $this->c->users->update($user);
             $this->c->users->update($user);
 
 
-            $vars  = [
+            $vars = [
                 ':uid' => $user->id,
                 ':uid' => $user->id,
             ];
             ];
             $query = 'DELETE
             $query = 'DELETE
@@ -40,7 +40,7 @@ class Markread extends Action
 
 
             $this->c->DB->exec($query, $vars);
             $this->c->DB->exec($query, $vars);
         } elseif ($forum->id > 0) {
         } elseif ($forum->id > 0) {
-            $vars  = [
+            $vars = [
                 ':uid'  => $user->id,
                 ':uid'  => $user->id,
                 ':fid'  => $forum->id,
                 ':fid'  => $forum->id,
                 ':mark' => \time(),
                 ':mark' => \time(),

+ 1 - 1
app/Models/Forum/Model.php

@@ -408,7 +408,7 @@ class Model extends DataModel
                 break;
                 break;
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':fid'    => $this->id,
             ':fid'    => $this->id,
             ':offset' => ($this->page - 1) * $this->c->user->disp_topics,
             ':offset' => ($this->page - 1) * $this->c->user->disp_topics,
             ':rows'   => $this->c->user->disp_topics,
             ':rows'   => $this->c->user->disp_topics,

+ 2 - 2
app/Models/Forum/Refresh.php

@@ -30,8 +30,8 @@ class Refresh extends Action
         $this->list = [];
         $this->list = [];
 
 
         if ('1' == $read) {
         if ('1' == $read) {
-            $list  = [];
-            $vars  = [
+            $list = [];
+            $vars = [
                 ':gid' => $gid,
                 ':gid' => $gid,
             ];
             ];
             $query = 'SELECT f.cat_id, c.cat_name, f.id, f.forum_name, f.redirect_url, f.parent_forum_id,
             $query = 'SELECT f.cat_id, c.cat_name, f.id, f.forum_name, f.redirect_url, f.parent_forum_id,

+ 1 - 1
app/Models/Forum/Save.php

@@ -49,7 +49,7 @@ class Save extends Action
             foreach ($forum->descendants as $f) {
             foreach ($forum->descendants as $f) {
                 $f->__cat_id = $values['cat_id'];
                 $f->__cat_id = $values['cat_id'];
             }
             }
-            $vars  = [
+            $vars = [
                 ':ids'      => \array_keys($forum->descendants),
                 ':ids'      => \array_keys($forum->descendants),
                 ':category' => $values['cat_id'],
                 ':category' => $values['cat_id'],
             ];
             ];

+ 1 - 1
app/Models/Group/Delete.php

@@ -20,7 +20,7 @@ class Delete extends Action
 
 
         $this->manager->Perm->delete($group);
         $this->manager->Perm->delete($group);
 
 
-        $vars  = [
+        $vars = [
             ':gid' => $group->g_id,
             ':gid' => $group->g_id,
         ];
         ];
         $query = 'DELETE
         $query = 'DELETE

+ 5 - 5
app/Models/Group/Perm.php

@@ -22,7 +22,7 @@ class Perm extends Action
      */
      */
     public function get(Forum $forum): array
     public function get(Forum $forum): array
     {
     {
-        $vars  = [
+        $vars = [
             ':fid' => $forum->id > 0 ? $forum->id : 0,
             ':fid' => $forum->id > 0 ? $forum->id : 0,
             ':adm' => $this->c->GROUP_ADMIN,
             ':adm' => $this->c->GROUP_ADMIN,
         ];
         ];
@@ -87,7 +87,7 @@ class Perm extends Action
                 $modDef
                 $modDef
                 || $modPerm
                 || $modPerm
             ) {
             ) {
-                $vars  = [
+                $vars = [
                     ':gid' => $id,
                     ':gid' => $id,
                     ':fid' => $forum->id,
                     ':fid' => $forum->id,
                 ];
                 ];
@@ -126,7 +126,7 @@ class Perm extends Action
             throw new RuntimeException('The forum does not have ID');
             throw new RuntimeException('The forum does not have ID');
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':fid' => $forum->id,
             ':fid' => $forum->id,
         ];
         ];
         $query = 'DELETE
         $query = 'DELETE
@@ -145,7 +145,7 @@ class Perm extends Action
             throw new RuntimeException('The group does not have ID');
             throw new RuntimeException('The group does not have ID');
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':gid' => $group->g_id,
             ':gid' => $group->g_id,
         ];
         ];
         $query = 'DELETE
         $query = 'DELETE
@@ -169,7 +169,7 @@ class Perm extends Action
 
 
         $this->delete($to);
         $this->delete($to);
 
 
-        $vars  = [
+        $vars = [
             ':old' => $from->g_id,
             ':old' => $from->g_id,
             ':new' => $to->g_id,
             ':new' => $to->g_id,
         ];
         ];

+ 2 - 2
app/Models/Online/Model.php

@@ -223,14 +223,14 @@ class Model extends ParentModel
     public function delete(User $user): void
     public function delete(User $user): void
     {
     {
         if ($user->isGuest) {
         if ($user->isGuest) {
-            $vars  = [
+            $vars = [
                 ':ip' => $user->ip,
                 ':ip' => $user->ip,
             ];
             ];
             $query = 'DELETE
             $query = 'DELETE
                 FROM ::online
                 FROM ::online
                 WHERE user_id=1 AND ident=?s:ip';
                 WHERE user_id=1 AND ident=?s:ip';
         } else {
         } else {
-            $vars  = [
+            $vars = [
                 ':id' => $user->id,
                 ':id' => $user->id,
             ];
             ];
             $query = 'DELETE
             $query = 'DELETE

+ 3 - 3
app/Models/Pages/Admin/Update.php

@@ -504,7 +504,7 @@ class Update extends Admin
         $this->c->DB->addField('groups', 'g_sig_length', 'SMALLINT UNSIGNED', false, 400);
         $this->c->DB->addField('groups', 'g_sig_length', 'SMALLINT UNSIGNED', false, 400);
         $this->c->DB->addField('groups', 'g_sig_lines', 'TINYINT UNSIGNED', false, 4);
         $this->c->DB->addField('groups', 'g_sig_lines', 'TINYINT UNSIGNED', false, 4);
 
 
-        $vars  = [
+        $vars = [
             ':sig_use'    => '1' == $this->c->config->o_signatures ? 1 : 0,
             ':sig_use'    => '1' == $this->c->config->o_signatures ? 1 : 0,
             ':sig_length' => $this->c->config->p_sig_length > 10000 ? 10000 : (int) $this->c->config->p_sig_length,
             ':sig_length' => $this->c->config->p_sig_length > 10000 ? 10000 : (int) $this->c->config->p_sig_length,
             ':sig_lines'  => $this->c->config->p_sig_lines> 255 ? 255 : (int) $this->c->config->p_sig_lines,
             ':sig_lines'  => $this->c->config->p_sig_lines> 255 ? 255 : (int) $this->c->config->p_sig_lines,
@@ -514,7 +514,7 @@ class Update extends Admin
 
 
         $this->c->DB->query($query, $vars);
         $this->c->DB->query($query, $vars);
 
 
-        $vars  = [
+        $vars = [
             ':grp' => $this->c->GROUP_ADMIN,
             ':grp' => $this->c->GROUP_ADMIN,
         ];
         ];
         $query = 'UPDATE ::groups
         $query = 'UPDATE ::groups
@@ -523,7 +523,7 @@ class Update extends Admin
 
 
         $this->c->DB->query($query, $vars);
         $this->c->DB->query($query, $vars);
 
 
-        $vars  = [
+        $vars = [
             ':grp' => $this->c->GROUP_GUEST,
             ':grp' => $this->c->GROUP_GUEST,
         ];
         ];
         $query = 'UPDATE ::groups
         $query = 'UPDATE ::groups

+ 1 - 1
app/Models/Poll/Delete.php

@@ -50,7 +50,7 @@ class Delete extends Action
             throw new InvalidArgumentException('Expected only Poll(s) or Topic(s)');
             throw new InvalidArgumentException('Expected only Poll(s) or Topic(s)');
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':tids' => $tids,
             ':tids' => $tids,
         ];
         ];
         $query = 'DELETE
         $query = 'DELETE

+ 1 - 1
app/Models/Poll/Load.php

@@ -19,7 +19,7 @@ class Load extends Action
             throw new InvalidArgumentException('Expected a positive poll id');
             throw new InvalidArgumentException('Expected a positive poll id');
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':tid' => $id,
             ':tid' => $id,
         ];
         ];
         $query = 'SELECT question_id, field_id, qna_text, votes
         $query = 'SELECT question_id, field_id, qna_text, votes

+ 3 - 3
app/Models/Post/Feed.php

@@ -24,7 +24,7 @@ class Feed extends Action
                 return [];
                 return [];
             }
             }
 
 
-            $vars  = [
+            $vars = [
                 ':id' => $model->id,
                 ':id' => $model->id,
             ];
             ];
             $query = 'SELECT p.id as pid, p.poster as username, p.poster_id as uid, p.message as content,
             $query = 'SELECT p.id as pid, p.poster as username, p.poster_id as uid, p.message as content,
@@ -34,7 +34,7 @@ class Feed extends Action
                 ORDER BY p.id DESC
                 ORDER BY p.id DESC
                 LIMIT 50';
                 LIMIT 50';
 
 
-        } else if ($model instanceof Forum) {
+        } elseif ($model instanceof Forum) {
             $ids = \array_keys($model->descendants);
             $ids = \array_keys($model->descendants);
             if ($model->id) {
             if ($model->id) {
                 $ids[] = $model->id;
                 $ids[] = $model->id;
@@ -44,7 +44,7 @@ class Feed extends Action
                 return [];
                 return [];
             }
             }
 
 
-            $vars  = [
+            $vars = [
                 ':forums' => $ids,
                 ':forums' => $ids,
             ];
             ];
             $query = 'SELECT p.id as pid, p.poster as username, p.poster_id as uid, p.message as content,
             $query = 'SELECT p.id as pid, p.poster as username, p.poster_id as uid, p.message as content,

+ 2 - 2
app/Models/Post/Load.php

@@ -42,7 +42,7 @@ class Load extends Action
             throw new InvalidArgumentException('Expected a positive topic id');
             throw new InvalidArgumentException('Expected a positive topic id');
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':pid' => $id,
             ':pid' => $id,
             ':tid' => $tid,
             ':tid' => $tid,
         ];
         ];
@@ -84,7 +84,7 @@ class Load extends Action
             }
             }
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':ids' => $ids,
             ':ids' => $ids,
         ];
         ];
         $query = $this->getSql('p.id IN (?ai:ids)');
         $query = $this->getSql('p.id IN (?ai:ids)');

+ 1 - 1
app/Models/Post/PreviousPost.php

@@ -14,7 +14,7 @@ class PreviousPost extends Action
      */
      */
     public function previousPost(Post $post, bool $returnId = true): ?int
     public function previousPost(Post $post, bool $returnId = true): ?int
     {
     {
-        $vars  = [
+        $vars = [
             ':pid' => $post->id,
             ':pid' => $post->id,
             ':tid' => $post->topic_id,
             ':tid' => $post->topic_id,
         ];
         ];

+ 1 - 1
app/Models/Post/RebuildIndex.php

@@ -14,7 +14,7 @@ class RebuildIndex extends Action
      */
      */
     public function rebuildIndex(int $start, int $limit, string $mode): int
     public function rebuildIndex(int $start, int $limit, string $mode): int
     {
     {
-        $vars  = [
+        $vars = [
             ':start' => $start,
             ':start' => $start,
             ':limit' => $limit,
             ':limit' => $limit,
         ];
         ];

+ 1 - 1
app/Models/Post/UserInfoFromIP.php

@@ -14,7 +14,7 @@ class UserInfoFromIP extends Action
      */
      */
     public function userInfoFromIP(string $ip): array
     public function userInfoFromIP(string $ip): array
     {
     {
-        $vars  = [
+        $vars = [
             ':ip' => $ip,
             ':ip' => $ip,
         ];
         ];
         $query = 'SELECT p.poster_id, p.poster
         $query = 'SELECT p.poster_id, p.poster

+ 1 - 1
app/Models/Post/UserStat.php

@@ -15,7 +15,7 @@ class UserStat extends Action
      */
      */
     public function userStat(int $id): array
     public function userStat(int $id): array
     {
     {
-        $vars  = [
+        $vars = [
             ':id' => $id,
             ':id' => $id,
         ];
         ];
         $query = 'SELECT p.poster_ip, MAX(p.posted) AS last_used, COUNT(p.id) AS used_times
         $query = 'SELECT p.poster_ip, MAX(p.posted) AS last_used, COUNT(p.id) AS used_times

+ 1 - 1
app/Models/Post/View.php

@@ -34,7 +34,7 @@ class View extends Action
         }
         }
 
 
         if (! $review) {
         if (! $review) {
-            $vars  = [
+            $vars = [
                 ':ids' => $arg->idsList,
                 ':ids' => $arg->idsList,
             ];
             ];
             $query = 'SELECT w.id, w.message, w.poster, w.posted
             $query = 'SELECT w.id, w.message, w.poster, w.posted

+ 1 - 1
app/Models/Report/Load.php

@@ -19,7 +19,7 @@ class Load extends Action
             throw new InvalidArgumentException('Expected a positive report id');
             throw new InvalidArgumentException('Expected a positive report id');
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':id' => $id,
             ':id' => $id,
         ];
         ];
         $query = 'SELECT r.*
         $query = 'SELECT r.*

+ 1 - 1
app/Models/Report/Manager.php

@@ -109,7 +109,7 @@ class Manager extends ManagerModel
         $time = (int) $this->c->DB->query($query)->fetchColumn();
         $time = (int) $this->c->DB->query($query)->fetchColumn();
 
 
         if ($time > 0) {
         if ($time > 0) {
-            $vars  = [
+            $vars = [
                 ':time' => $time,
                 ':time' => $time,
             ];
             ];
             $query = 'DELETE
             $query = 'DELETE

+ 4 - 4
app/Models/Search/Delete.php

@@ -76,7 +76,7 @@ class Delete extends Method
         $query = null;
         $query = null;
 
 
         if ($users) {
         if ($users) {
-            $vars  = [
+            $vars = [
                 ':users' => $users,
                 ':users' => $users,
             ];
             ];
             $query = 'DELETE
             $query = 'DELETE
@@ -88,7 +88,7 @@ class Delete extends Method
                 )';
                 )';
         }
         }
         if ($forums) {
         if ($forums) {
-            $vars  = [
+            $vars = [
                 ':forums' => \array_keys($forums),
                 ':forums' => \array_keys($forums),
             ];
             ];
             $query = 'DELETE
             $query = 'DELETE
@@ -101,7 +101,7 @@ class Delete extends Method
                 )';
                 )';
         }
         }
         if ($topics) {
         if ($topics) {
-            $vars  = [
+            $vars = [
                 ':topics' => \array_keys($topics),
                 ':topics' => \array_keys($topics),
             ];
             ];
             $query = 'DELETE
             $query = 'DELETE
@@ -113,7 +113,7 @@ class Delete extends Method
                 )';
                 )';
         }
         }
         if ($posts) {
         if ($posts) {
-            $vars  = [
+            $vars = [
                 ':posts' => \array_keys($posts),
                 ':posts' => \array_keys($posts),
             ];
             ];
             $query = 'DELETE
             $query = 'DELETE

+ 2 - 2
app/Models/Search/Execute.php

@@ -48,7 +48,7 @@ class Execute extends Method
                $v->author . '-' .
                $v->author . '-' .
                $v->forums;
                $v->forums;
 
 
-        $vars  = [
+        $vars = [
             ':key' => $key,
             ':key' => $key,
         ];
         ];
         $query = 'SELECT sc.search_time, sc.search_data
         $query = 'SELECT sc.search_time, sc.search_data
@@ -83,7 +83,7 @@ class Execute extends Method
         $data  = [
         $data  = [
             \implode(',', $ids),
             \implode(',', $ids),
         ];
         ];
-        $vars  = [
+        $vars = [
             ':data' => \implode("\n", $data),
             ':data' => \implode("\n", $data),
             ':key'  => $key,
             ':key'  => $key,
             ':time' => \time(),
             ':time' => \time(),

+ 4 - 4
app/Models/Search/Index.php

@@ -22,7 +22,7 @@ class Index extends Method
             : [];
             : [];
 
 
         if ('add' !== $mode) {
         if ('add' !== $mode) {
-            $vars  = [
+            $vars = [
                 ':pid' => $post->id,
                 ':pid' => $post->id,
             ];
             ];
             $query = 'SELECT sw.id, sw.word, sm.subject_match
             $query = 'SELECT sw.id, sw.word, sm.subject_match
@@ -67,7 +67,7 @@ class Index extends Method
             $allWords = \array_unique(\array_merge($words['add']['p'], $words['add']['s']));
             $allWords = \array_unique(\array_merge($words['add']['p'], $words['add']['s']));
         }
         }
         if (! empty($allWords)) {
         if (! empty($allWords)) {
-            $vars  = [
+            $vars = [
                 ':words' => $allWords,
                 ':words' => $allWords,
             ];
             ];
             $query = 'SELECT sw.word
             $query = 'SELECT sw.word
@@ -97,7 +97,7 @@ class Index extends Method
                 continue;
                 continue;
             }
             }
 
 
-            $vars  = [
+            $vars = [
                 ':pid'  => $post->id,
                 ':pid'  => $post->id,
                 ':subj' => 's' === $key ? 1 : 0,
                 ':subj' => 's' === $key ? 1 : 0,
                 ':ids'  => $list,
                 ':ids'  => $list,
@@ -115,7 +115,7 @@ class Index extends Method
                 continue;
                 continue;
             }
             }
 
 
-            $vars  = [
+            $vars = [
                 ':pid'   => $post->id,
                 ':pid'   => $post->id,
                 ':subj'  => 's' === $key ? 1 : 0,
                 ':subj'  => 's' === $key ? 1 : 0,
                 ':words' => $list,
                 ':words' => $list,

+ 1 - 1
app/Models/Topic/Access.php

@@ -21,7 +21,7 @@ class Access extends Action
         }
         }
 
 
         if (! empty($ids)) {
         if (! empty($ids)) {
-            $vars  = [
+            $vars = [
                 ':ids'    => $ids,
                 ':ids'    => $ids,
                 ':closed' => $open ? 0 : 1,
                 ':closed' => $open ? 0 : 1,
             ];
             ];

+ 1 - 1
app/Models/Topic/CalcStat.php

@@ -22,7 +22,7 @@ class CalcStat extends Method
         if ($this->model->moved_to) {
         if ($this->model->moved_to) {
             $numReplies = 0;
             $numReplies = 0;
         } else {
         } else {
-            $vars  = [
+            $vars = [
                 ':tid' => $this->model->id
                 ':tid' => $this->model->id
             ];
             ];
             $query = 'SELECT COUNT(p.id) - 1
             $query = 'SELECT COUNT(p.id) - 1

+ 2 - 2
app/Models/Topic/Load.php

@@ -46,7 +46,7 @@ class Load extends Action
             throw new InvalidArgumentException('Expected a positive topic id');
             throw new InvalidArgumentException('Expected a positive topic id');
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':tid' => $id,
             ':tid' => $id,
             ':uid' => $this->c->user->id,
             ':uid' => $this->c->user->id,
         ];
         ];
@@ -87,7 +87,7 @@ class Load extends Action
             }
             }
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':ids' => $ids,
             ':ids' => $ids,
             ':uid' => $this->c->user->id,
             ':uid' => $this->c->user->id,
         ];
         ];

+ 3 - 3
app/Models/Topic/Merge.php

@@ -48,7 +48,7 @@ class Merge extends Action
         }
         }
 
 
         //???? перенести обработку в посты?
         //???? перенести обработку в посты?
-        $vars  = [
+        $vars = [
             'start'  => "[from]",
             'start'  => "[from]",
             'end'    => "[/from]\n",
             'end'    => "[/from]\n",
             'topics' => $ids,
             'topics' => $ids,
@@ -59,7 +59,7 @@ class Merge extends Action
 
 
         $this->c->DB->exec($query, $vars);
         $this->c->DB->exec($query, $vars);
 
 
-        $vars  = [
+        $vars = [
             'id'     => $firstTopic->id,
             'id'     => $firstTopic->id,
             'topics' => $ids,
             'topics' => $ids,
         ];
         ];
@@ -77,7 +77,7 @@ class Merge extends Action
                 $this->c->topics->update($topic->calcStat());
                 $this->c->topics->update($topic->calcStat());
             }
             }
 
 
-            $vars  = [
+            $vars = [
                 'topics' => $ids,
                 'topics' => $ids,
             ];
             ];
             $query = 'SELECT t.id
             $query = 'SELECT t.id

+ 6 - 6
app/Models/Topic/Model.php

@@ -231,7 +231,7 @@ class Model extends DataModel
             return 0;
             return 0;
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':tid'   => $this->id,
             ':tid'   => $this->id,
             ':visit' => $this->hasNew,
             ':visit' => $this->hasNew,
         ];
         ];
@@ -253,7 +253,7 @@ class Model extends DataModel
             return 0;
             return 0;
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':tid'   => $this->id,
             ':tid'   => $this->id,
             ':visit' => $this->hasUnread,
             ':visit' => $this->hasUnread,
         ];
         ];
@@ -321,7 +321,7 @@ class Model extends DataModel
             throw new InvalidArgumentException('Bad number of displayed page');
             throw new InvalidArgumentException('Bad number of displayed page');
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':tid'    => $this->id,
             ':tid'    => $this->id,
             ':offset' => ($this->page - 1) * $this->c->user->disp_posts,
             ':offset' => ($this->page - 1) * $this->c->user->disp_posts,
             ':rows'   => $this->c->user->disp_posts,
             ':rows'   => $this->c->user->disp_posts,
@@ -364,7 +364,7 @@ class Model extends DataModel
 
 
         $this->page = 1;
         $this->page = 1;
 
 
-        $vars  = [
+        $vars = [
             ':tid'  => $this->id,
             ':tid'  => $this->id,
             ':rows' => $this->c->config->i_topic_review,
             ':rows' => $this->c->config->i_topic_review,
         ];
         ];
@@ -384,7 +384,7 @@ class Model extends DataModel
      */
      */
     public function calcPage(int $pid): void
     public function calcPage(int $pid): void
     {
     {
-        $vars  = [
+        $vars = [
             ':tid' => $this->id,
             ':tid' => $this->id,
             ':pid' => $pid,
             ':pid' => $pid,
         ];
         ];
@@ -411,7 +411,7 @@ class Model extends DataModel
      */
      */
     public function incViews(): void
     public function incViews(): void
     {
     {
-        $vars  = [
+        $vars = [
             ':tid' => $this->id,
             ':tid' => $this->id,
         ];
         ];
         $query = 'UPDATE ::topics
         $query = 'UPDATE ::topics

+ 1 - 1
app/Models/Topic/View.php

@@ -40,7 +40,7 @@ class View extends Action
             ! $this->c->user->isGuest
             ! $this->c->user->isGuest
             && '1' == $this->c->config->o_show_dot
             && '1' == $this->c->config->o_show_dot
         ) {
         ) {
-            $vars  = [
+            $vars = [
                 ':uid' => $this->c->user->id,
                 ':uid' => $this->c->user->id,
                 ':ids' => $arg->idsList,
                 ':ids' => $arg->idsList,
             ];
             ];

+ 1 - 1
app/Models/User/AdminsIds.php

@@ -14,7 +14,7 @@ class AdminsIds extends Action
      */
      */
     public function adminsIds(): array
     public function adminsIds(): array
     {
     {
-        $vars  = [
+        $vars = [
             ':gid' => $this->c->GROUP_ADMIN,
             ':gid' => $this->c->GROUP_ADMIN,
         ];
         ];
         $query = 'SELECT u.id
         $query = 'SELECT u.id

+ 1 - 1
app/Models/User/ChangeGroup.php

@@ -61,7 +61,7 @@ class ChangeGroup extends Action
             }
             }
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':new' => $newGroupId,
             ':new' => $newGroupId,
             ':ids' => $ids,
             ':ids' => $ids,
         ];
         ];

+ 1 - 1
app/Models/User/IsUniqueName.php

@@ -14,7 +14,7 @@ class IsUniqueName extends Action
      */
      */
     public function isUniqueName(User $user): bool
     public function isUniqueName(User $user): bool
     {
     {
-        $vars  = [
+        $vars = [
             ':id'    => (int) $user->id,
             ':id'    => (int) $user->id,
             ':name'  => $user->username,
             ':name'  => $user->username,
         ];
         ];

+ 12 - 4
app/Models/User/Load.php

@@ -33,7 +33,9 @@ class Load extends Action
             throw new InvalidArgumentException('Expected a positive user id');
             throw new InvalidArgumentException('Expected a positive user id');
         }
         }
 
 
-        $vars  = [':id' => $id];
+        $vars = [
+            ':id' => $id,
+        ];
         $query = $this->getSql('u.id=?i:id');
         $query = $this->getSql('u.id=?i:id');
 
 
         $data = $this->c->DB->query($query, $vars)->fetch();
         $data = $this->c->DB->query($query, $vars)->fetch();
@@ -55,7 +57,9 @@ class Load extends Action
             }
             }
         }
         }
 
 
-        $vars  = [':ids' => $ids];
+        $vars = [
+            ':ids' => $ids,
+        ];
         $query = $this->getSql('u.id IN (?ai:ids)');
         $query = $this->getSql('u.id IN (?ai:ids)');
 
 
         $data = $this->c->DB->query($query, $vars)->fetchAll();
         $data = $this->c->DB->query($query, $vars)->fetchAll();
@@ -89,8 +93,10 @@ class Load extends Action
      */
      */
     public function loadByName(string $name, bool $caseInsencytive = false): ?User
     public function loadByName(string $name, bool $caseInsencytive = false): ?User
     {
     {
+        $vars = [
+            ':name' => $name,
+        ];
         $where = $caseInsencytive ? 'LOWER(u.username)=LOWER(?s:name)' : 'u.username=?s:name';
         $where = $caseInsencytive ? 'LOWER(u.username)=LOWER(?s:name)' : 'u.username=?s:name';
-        $vars  = [':name' => $name];
         $query = $this->getSql($where);
         $query = $this->getSql($where);
 
 
         return $this->returnUser($query, $vars);
         return $this->returnUser($query, $vars);
@@ -101,7 +107,9 @@ class Load extends Action
      */
      */
     public function loadByEmail(string $email): ?User
     public function loadByEmail(string $email): ?User
     {
     {
-        $vars  = [':email' => $this->c->NormEmail->normalize($email)];
+        $vars = [
+            ':email' => $this->c->NormEmail->normalize($email),
+        ];
         $query = $this->getSql('u.email_normal=?s:email');
         $query = $this->getSql('u.email_normal=?s:email');
 
 
         return $this->returnUser($query, $vars);
         return $this->returnUser($query, $vars);

+ 2 - 2
app/Models/User/Promote.php

@@ -19,7 +19,7 @@ class Promote extends Action
 
 
         // перемещение всех пользователей из группы 0 в группу 1
         // перемещение всех пользователей из группы 0 в группу 1
         if (2 == $count) {
         if (2 == $count) {
-            $vars  = [
+            $vars = [
                 ':old' => $args[0]->g_id,
                 ':old' => $args[0]->g_id,
                 ':new' => $args[1]->g_id,
                 ':new' => $args[1]->g_id,
             ];
             ];
@@ -30,7 +30,7 @@ class Promote extends Action
             return $this->c->DB->exec($query, $vars);
             return $this->c->DB->exec($query, $vars);
         // продвижение всех пользователей в группе 0
         // продвижение всех пользователей в группе 0
         } elseif (1 == $count) {
         } elseif (1 == $count) {
-            $vars  = [
+            $vars = [
                 ':old'   => $args[0]->g_id,
                 ':old'   => $args[0]->g_id,
                 ':new'   => $args[0]->g_promote_next_group,
                 ':new'   => $args[0]->g_promote_next_group,
                 ':count' => $args[0]->g_promote_min_posts,
                 ':count' => $args[0]->g_promote_min_posts,

+ 1 - 1
app/Models/User/UpdateLastVisit.php

@@ -19,7 +19,7 @@ class UpdateLastVisit extends Action
             throw new RuntimeException('Expected user');
             throw new RuntimeException('Expected user');
         }
         }
         if ($user->logged > 0) {
         if ($user->logged > 0) {
-            $vars  = [
+            $vars = [
                 ':loggid' => $user->logged,
                 ':loggid' => $user->logged,
                 ':id'     => $user->id,
                 ':id'     => $user->id,
             ];
             ];

+ 1 - 1
app/Models/User/UsersNumber.php

@@ -21,7 +21,7 @@ class UsersNumber extends Action
             return 0;
             return 0;
         }
         }
 
 
-        $vars  = [
+        $vars = [
             ':gid' => $group->g_id,
             ':gid' => $group->g_id,
         ];
         ];
         $query = 'SELECT COUNT(u.id)
         $query = 'SELECT COUNT(u.id)

+ 3 - 3
app/config/defaultBBCode.php

@@ -364,11 +364,11 @@ $fUrl = \str_replace([' ', '\'', '`', '"'], ['%20', '', '', ''], $url);
 
 
 if (\strpos($url, 'www.') === 0) {
 if (\strpos($url, 'www.') === 0) {
     $fUrl = 'http://'.$fUrl;
     $fUrl = 'http://'.$fUrl;
-} else if (\strpos($url, 'ftp.') === 0) {
+} elseif (\strpos($url, 'ftp.') === 0) {
     $fUrl = 'ftp://'.$fUrl;
     $fUrl = 'ftp://'.$fUrl;
-} else if (\strpos($url, '/') === 0) {
+} elseif (\strpos($url, '/') === 0) {
     $fUrl = $parser->attr('baseUrl') . $fUrl;
     $fUrl = $parser->attr('baseUrl') . $fUrl;
-} else if (! \preg_match('%^([a-z0-9]{3,6})://%', $url)) {
+} elseif (! \preg_match('%^([a-z0-9]{3,6})://%', $url)) {
     $fUrl = 'http://'.$fUrl;
     $fUrl = 'http://'.$fUrl;
 }
 }