Visman 5 anni fa
parent
commit
0799853a93
83 ha cambiato i file con 365 aggiunte e 42 eliminazioni
  1. 1 0
      app/Controllers/Install.php
  2. 1 0
      app/Controllers/Primary.php
  3. 1 0
      app/Controllers/Routing.php
  4. 4 0
      app/Core/Cache/FileCache.php
  5. 3 0
      app/Core/Container.php
  6. 1 0
      app/Core/Csrf.php
  7. 9 0
      app/Core/DB.php
  8. 14 0
      app/Core/DB/mysql.php
  9. 1 0
      app/Core/DBStatement.php
  10. 2 0
      app/Core/ErrorHandler.php
  11. 7 0
      app/Core/File.php
  12. 8 0
      app/Core/Files.php
  13. 4 0
      app/Core/Func.php
  14. 2 0
      app/Core/Image.php
  15. 1 0
      app/Core/Lang.php
  16. 15 0
      app/Core/Mail.php
  17. 1 0
      app/Core/Parser.php
  18. 42 8
      app/Core/Router.php
  19. 2 0
      app/Core/Secury.php
  20. 36 7
      app/Core/Validator.php
  21. 2 0
      app/Core/View.php
  22. 1 0
      app/Models/Action.php
  23. 2 0
      app/Models/AdminList/Model.php
  24. 1 3
      app/Models/BanList/Filter.php
  25. 1 0
      app/Models/BanList/Load.php
  26. 1 0
      app/Models/Censorship/Model.php
  27. 1 0
      app/Models/Censorship/Refresh.php
  28. 1 0
      app/Models/Config/Install.php
  29. 1 0
      app/Models/Config/Load.php
  30. 1 0
      app/Models/Config/Model.php
  31. 1 0
      app/Models/Config/Save.php
  32. 3 0
      app/Models/Cookie/Model.php
  33. 2 0
      app/Models/DBMap/Model.php
  34. 3 0
      app/Models/Forum/Manager.php
  35. 13 5
      app/Models/Forum/Model.php
  36. 3 0
      app/Models/Forum/Refresh.php
  37. 2 0
      app/Models/Group/Manager.php
  38. 1 0
      app/Models/Group/Model.php
  39. 1 0
      app/Models/Method.php
  40. 6 0
      app/Models/Page.php
  41. 10 1
      app/Models/Pages/Admin/Bans.php
  42. 1 0
      app/Models/Pages/Admin/Forums.php
  43. 4 0
      app/Models/Pages/Admin/Groups.php
  44. 6 1
      app/Models/Pages/Admin/Maintenance.php
  45. 2 0
      app/Models/Pages/Admin/Options.php
  46. 14 3
      app/Models/Pages/Admin/Statistics.php
  47. 9 0
      app/Models/Pages/Admin/Users.php
  48. 4 0
      app/Models/Pages/Admin/Users/Action.php
  49. 4 2
      app/Models/Pages/Admin/Users/NewUser.php
  50. 9 1
      app/Models/Pages/Admin/Users/Result.php
  51. 8 1
      app/Models/Pages/Admin/Users/Stat.php
  52. 2 0
      app/Models/Pages/Auth.php
  53. 4 0
      app/Models/Pages/Install.php
  54. 14 0
      app/Models/Pages/Moderate.php
  55. 1 0
      app/Models/Pages/PostValidatorTrait.php
  56. 1 0
      app/Models/Pages/Profile.php
  57. 1 1
      app/Models/Pages/Profile/Config.php
  58. 3 0
      app/Models/Pages/Redirect.php
  59. 3 0
      app/Models/Pages/Register.php
  60. 13 2
      app/Models/Pages/Rules.php
  61. 2 0
      app/Models/Pages/Search.php
  62. 6 1
      app/Models/Pages/Userlist.php
  63. 1 0
      app/Models/Post/Manager.php
  64. 3 0
      app/Models/Report/Manager.php
  65. 1 0
      app/Models/Search/Execute.php
  66. 1 0
      app/Models/Search/Index.php
  67. 2 0
      app/Models/Search/Prepare.php
  68. 1 0
      app/Models/SmileyList/Load.php
  69. 1 0
      app/Models/SmileyList/Model.php
  70. 1 0
      app/Models/Stats/Model.php
  71. 3 0
      app/Models/Stopwords/Model.php
  72. 2 0
      app/Models/Topic/Load.php
  73. 2 0
      app/Models/Topic/Manager.php
  74. 9 1
      app/Models/Topic/Model.php
  75. 4 0
      app/Models/User/Current.php
  76. 1 3
      app/Models/User/Filter.php
  77. 1 0
      app/Models/User/IsUniqueName.php
  78. 1 0
      app/Models/User/Load.php
  79. 2 0
      app/Models/User/Manager.php
  80. 1 0
      app/Models/User/Model.php
  81. 2 0
      app/Models/Validators/Email.php
  82. 1 0
      app/Models/Validators/NoURL.php
  83. 2 2
      app/config/defaultBBCode.php

+ 1 - 0
app/Controllers/Install.php

@@ -61,6 +61,7 @@ class Install
                 $page = $this->c->Redirect->page('Install')->message('Redirect to install');
                 $page = $this->c->Redirect->page('Install')->message('Redirect to install');
                 break;
                 break;
         }
         }
+
         return $page;
         return $page;
     }
     }
 }
 }

+ 1 - 0
app/Controllers/Primary.php

@@ -40,6 +40,7 @@ class Primary
                 if (! $this->c->isInit('user')) {
                 if (! $this->c->isInit('user')) {
                     $this->c->user = $this->c->users->create(['id' => 1, 'group_id' => $this->c->GROUP_GUEST]);
                     $this->c->user = $this->c->users->create(['id' => 1, 'group_id' => $this->c->GROUP_GUEST]);
                 }
                 }
+
                 return $this->c->Maintenance;
                 return $this->c->Maintenance;
             }
             }
         }
         }

+ 1 - 0
app/Controllers/Routing.php

@@ -625,6 +625,7 @@ class Routing
                 $page = $this->c->Message->message('Bad request', true, 501);
                 $page = $this->c->Message->message('Bad request', true, 501);
                 break;
                 break;
         }
         }
+
         return $page;
         return $page;
     }
     }
 }
 }

+ 4 - 0
app/Core/Cache/FileCache.php

@@ -63,6 +63,7 @@ class FileCache implements ProviderCacheInterface
                 return $data;
                 return $data;
             }
             }
         }
         }
+
         return $default;
         return $default;
     }
     }
 
 
@@ -86,6 +87,7 @@ class FileCache implements ProviderCacheInterface
             throw new RuntimeException("The key '$key' can not be saved");
             throw new RuntimeException("The key '$key' can not be saved");
         } else {
         } else {
             $this->invalidate($file);
             $this->invalidate($file);
+
             return true;
             return true;
         }
         }
     }
     }
@@ -105,6 +107,7 @@ class FileCache implements ProviderCacheInterface
         if (\is_file($file)) {
         if (\is_file($file)) {
             if (\unlink($file)) {
             if (\unlink($file)) {
                 $this->invalidate($file);
                 $this->invalidate($file);
+
                 return true;
                 return true;
             } else {
             } else {
                 throw new RuntimeException("The key `$key` could not be removed");
                 throw new RuntimeException("The key `$key` could not be removed");
@@ -129,6 +132,7 @@ class FileCache implements ProviderCacheInterface
         foreach ($files as $file) {
         foreach ($files as $file) {
             $result = \unlink($file->getPathname()) && $result;
             $result = \unlink($file->getPathname()) && $result;
         }
         }
+
         return $result;
         return $result;
     }
     }
 
 

+ 3 - 0
app/Core/Container.php

@@ -109,6 +109,7 @@ class Container
         if ($toShare) {
         if ($toShare) {
             $this->instances[$id] = $service;
             $this->instances[$id] = $service;
         }
         }
+
         return $service;
         return $service;
     }
     }
 
 
@@ -146,6 +147,7 @@ class Container
                 return null;
                 return null;
             }
             }
         }
         }
+
         return $ptr;
         return $ptr;
     }
     }
 
 
@@ -210,6 +212,7 @@ class Container
             }
             }
             unset($v);
             unset($v);
         }
         }
+
         return $value;
         return $value;
     }
     }
 
 

+ 1 - 0
app/Core/Csrf.php

@@ -46,6 +46,7 @@ class Csrf
              $marker .= $key . '|' . (string) $value . '|';
              $marker .= $key . '|' . (string) $value . '|';
          }
          }
          $time = $time ?: \time();
          $time = $time ?: \time();
+
          return $this->secury->hmac($marker, $time . $this->key) . 'f' . $time;
          return $this->secury->hmac($marker, $time . $this->key) . 'f' . $time;
     }
     }
 
 

+ 9 - 0
app/Core/DB.php

@@ -95,6 +95,7 @@ class DB extends PDO
             $drv = 'ForkBB\\Core\\DB\\' . \ucfirst($this->dbType);
             $drv = 'ForkBB\\Core\\DB\\' . \ucfirst($this->dbType);
             $this->dbDrv = new $drv($this, $this->dbPrefix);
             $this->dbDrv = new $drv($this, $this->dbPrefix);
         }
         }
+
         return $this->dbDrv->$name(...$args);
         return $this->dbDrv->$name(...$args);
     }
     }
 
 
@@ -117,6 +118,7 @@ class DB extends PDO
                return false;
                return false;
            }
            }
         }
         }
+
         return true;
         return true;
     }
     }
 
 
@@ -178,10 +180,12 @@ class DB extends PDO
                     $res[]       = $name;
                     $res[]       = $name;
                     $map[$key][] = $name;
                     $map[$key][] = $name;
                 }
                 }
+
                 return \implode(',', $res);
                 return \implode(',', $res);
             },
             },
             $query
             $query
         );
         );
+
         return $map;
         return $map;
     }
     }
 
 
@@ -267,6 +271,7 @@ class DB extends PDO
             $start  = \microtime(true);
             $start  = \microtime(true);
             $result = parent::exec($query);
             $result = parent::exec($query);
             $this->saveQuery($query, \microtime(true) - $start);
             $this->saveQuery($query, \microtime(true) - $start);
+
             return $result;
             return $result;
         }
         }
 
 
@@ -346,6 +351,7 @@ class DB extends PDO
             $start  = \microtime(true);
             $start  = \microtime(true);
             $result = parent::query($query, ...$args);
             $result = parent::query($query, ...$args);
             $this->saveQuery($query, \microtime(true) - $start);
             $this->saveQuery($query, \microtime(true) - $start);
+
             return $result;
             return $result;
         }
         }
 
 
@@ -374,6 +380,7 @@ class DB extends PDO
         $start  = \microtime(true);
         $start  = \microtime(true);
         $result = parent::beginTransaction();
         $result = parent::beginTransaction();
         $this->saveQuery('beginTransaction()', \microtime(true) - $start, false);
         $this->saveQuery('beginTransaction()', \microtime(true) - $start, false);
+
         return $result;
         return $result;
     }
     }
 
 
@@ -385,6 +392,7 @@ class DB extends PDO
         $start  = \microtime(true);
         $start  = \microtime(true);
         $result = parent::commit();
         $result = parent::commit();
         $this->saveQuery('commit()', \microtime(true) - $start, false);
         $this->saveQuery('commit()', \microtime(true) - $start, false);
+
         return $result;
         return $result;
     }
     }
 
 
@@ -396,6 +404,7 @@ class DB extends PDO
         $start  = \microtime(true);
         $start  = \microtime(true);
         $result = parent::rollback();
         $result = parent::rollback();
         $this->saveQuery('rollback()', \microtime(true) - $start, false);
         $this->saveQuery('rollback()', \microtime(true) - $start, false);
+
         return $result;
         return $result;
     }
     }
 }
 }

+ 14 - 0
app/Core/DB/mysql.php

@@ -108,6 +108,7 @@ class Mysql
             }
             }
             unset($value);
             unset($value);
         }
         }
+
         return \implode(',', $arr);
         return \implode(',', $arr);
     }
     }
 
 
@@ -170,6 +171,7 @@ class Mysql
         } catch (PDOException $e) {
         } catch (PDOException $e) {
             return false;
             return false;
         }
         }
+
         return ! empty($result);
         return ! empty($result);
     }
     }
 
 
@@ -200,6 +202,7 @@ class Mysql
         } catch (PDOException $e) {
         } catch (PDOException $e) {
             return false;
             return false;
         }
         }
+
         return ! empty($result);
         return ! empty($result);
     }
     }
 
 
@@ -231,6 +234,7 @@ class Mysql
         } catch (PDOException $e) {
         } catch (PDOException $e) {
             return false;
             return false;
         }
         }
+
         return ! empty($result);
         return ! empty($result);
     }
     }
 
 
@@ -316,6 +320,7 @@ class Mysql
         }
         }
         $this->testStr($engine);
         $this->testStr($engine);
         $query = \rtrim($query, ', ') . ") ENGINE={$engine} CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci";
         $query = \rtrim($query, ', ') . ") ENGINE={$engine} CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci";
+
         return false !== $this->db->exec($query);
         return false !== $this->db->exec($query);
     }
     }
 
 
@@ -331,6 +336,7 @@ class Mysql
     {
     {
         $table = ($noPrefix ? '' : $this->dbPrefix) . $table;
         $table = ($noPrefix ? '' : $this->dbPrefix) . $table;
         $this->testStr($table);
         $this->testStr($table);
+
         return false !== $this->db->exec("DROP TABLE IF EXISTS `{$table}`");
         return false !== $this->db->exec("DROP TABLE IF EXISTS `{$table}`");
     }
     }
 
 
@@ -355,6 +361,7 @@ class Mysql
         $this->testStr($old);
         $this->testStr($old);
         $new = ($noPrefix ? '' : $this->dbPrefix) . $new;
         $new = ($noPrefix ? '' : $this->dbPrefix) . $new;
         $this->testStr($new);
         $this->testStr($new);
+
         return false !== $this->db->exec("ALTER TABLE `{$old}` RENAME TO `{$new}`");
         return false !== $this->db->exec("ALTER TABLE `{$old}` RENAME TO `{$new}`");
     }
     }
 
 
@@ -390,6 +397,7 @@ class Mysql
             $this->testStr($after);
             $this->testStr($after);
             $query .= " AFTER `{$after}`";
             $query .= " AFTER `{$after}`";
         }
         }
+
         return false !== $this->db->exec($query);
         return false !== $this->db->exec($query);
     }
     }
 
 
@@ -422,6 +430,7 @@ class Mysql
             $this->testStr($after);
             $this->testStr($after);
             $query .= " AFTER `{$after}`";
             $query .= " AFTER `{$after}`";
         }
         }
+
         return false !== $this->db->exec($query);
         return false !== $this->db->exec($query);
     }
     }
 
 
@@ -442,6 +451,7 @@ class Mysql
         $table = ($noPrefix ? '' : $this->dbPrefix) . $table;
         $table = ($noPrefix ? '' : $this->dbPrefix) . $table;
         $this->testStr($table);
         $this->testStr($table);
         $this->testStr($field);
         $this->testStr($field);
+
         return false !== $this->db->exec("ALTER TABLE `{$table}` DROP COLUMN `{$field}`");
         return false !== $this->db->exec("ALTER TABLE `{$table}` DROP COLUMN `{$field}`");
     }
     }
 
 
@@ -476,6 +486,7 @@ class Mysql
             }
             }
         }
         }
         $query .= ' (' . $this->replIdxs($fields) . ')';
         $query .= ' (' . $this->replIdxs($fields) . ')';
+
         return false !== $this->db->exec($query);
         return false !== $this->db->exec($query);
     }
     }
 
 
@@ -503,6 +514,7 @@ class Mysql
             $this->testStr($index);
             $this->testStr($index);
             $query .= "DROP INDEX `{$index}`";
             $query .= "DROP INDEX `{$index}`";
         }
         }
+
         return false !== $this->db->exec($query);
         return false !== $this->db->exec($query);
     }
     }
 
 
@@ -518,6 +530,7 @@ class Mysql
     {
     {
         $table = ($noPrefix ? '' : $this->dbPrefix) . $table;
         $table = ($noPrefix ? '' : $this->dbPrefix) . $table;
         $this->testStr($table);
         $this->testStr($table);
+
         return false !== $this->db->exec("TRUNCATE TABLE `{$table}`");
         return false !== $this->db->exec("TRUNCATE TABLE `{$table}`");
     }
     }
 
 
@@ -588,6 +601,7 @@ class Mysql
             $type = \strtolower($row['DATA_TYPE']);
             $type = \strtolower($row['DATA_TYPE']);
             $result[$tableNoPref][$row['COLUMN_NAME']] = $this->types[$type] ?? 's';
             $result[$tableNoPref][$row['COLUMN_NAME']] = $this->types[$type] ?? 's';
         }
         }
+
         return $result;
         return $result;
     }
     }
 }
 }

+ 1 - 0
app/Core/DBStatement.php

@@ -101,6 +101,7 @@ class DBStatement extends PDOStatement
         $start  = \microtime(true);
         $start  = \microtime(true);
         $result = parent::execute();
         $result = parent::execute();
         $this->db->saveQuery($this->queryString, \microtime(true) - $start);
         $this->db->saveQuery($this->queryString, \microtime(true) - $start);
+
         return $result;
         return $result;
     }
     }
 }
 }

+ 2 - 0
app/Core/ErrorHandler.php

@@ -106,6 +106,7 @@ class ErrorHandler
         }
         }
 
 
         $this->logged = false;
         $this->logged = false;
+
         return true;
         return true;
     }
     }
 
 
@@ -290,6 +291,7 @@ EOT;
     {
     {
         $type = $this->type[$error['type']] ?? $this->type[0];
         $type = $this->type[$error['type']] ?? $this->type[0];
         $file = \str_replace($this->hidePath, '...', $error['file']);
         $file = \str_replace($this->hidePath, '...', $error['file']);
+
         return "PHP {$type}: \"{$error['message']}\" in {$file}:[{$error['line']}]";
         return "PHP {$type}: \"{$error['message']}\" in {$file}:[{$error['line']}]";
     }
     }
 
 

+ 7 - 0
app/Core/File.php

@@ -146,6 +146,7 @@ class File
     {
     {
         if (! \preg_match($this->pattern, $path, $matches)) {
         if (! \preg_match($this->pattern, $path, $matches)) {
             $this->error = 'The path/name format is broken';
             $this->error = 'The path/name format is broken';
+
             return null;
             return null;
         }
         }
 
 
@@ -213,11 +214,13 @@ class File
         if (! \is_dir($dirname)) {
         if (! \is_dir($dirname)) {
             if (! @\mkdir($dirname, 0755)) {
             if (! @\mkdir($dirname, 0755)) {
                 $this->error = 'Can not create directory';
                 $this->error = 'Can not create directory';
+
                 return false;
                 return false;
             }
             }
         }
         }
         if (! \is_writable($dirname)) {
         if (! \is_writable($dirname)) {
             $this->error = 'No write access for directory';
             $this->error = 'No write access for directory';
+
             return false;
             return false;
         }
         }
 
 
@@ -236,11 +239,13 @@ class File
         if (\is_string($this->data)) {
         if (\is_string($this->data)) {
             if (! \file_put_contents($this->path, $path)) {
             if (! \file_put_contents($this->path, $path)) {
                 $this->error = 'Error writing file';
                 $this->error = 'Error writing file';
+
                 return false;
                 return false;
             }
             }
         } else {
         } else {
             if (! \copy($this->path, $path)) {
             if (! \copy($this->path, $path)) {
                 $this->error = 'Error copying file';
                 $this->error = 'Error copying file';
+
                 return false;
                 return false;
             }
             }
         }
         }
@@ -279,6 +284,7 @@ class File
             && \file_exists($info['dirname'] . $info['filename'] . '.' . $info['extension'])
             && \file_exists($info['dirname'] . $info['filename'] . '.' . $info['extension'])
         ) {
         ) {
             $this->error = 'Such file already exists';
             $this->error = 'Such file already exists';
+
             return false;
             return false;
         }
         }
 
 
@@ -289,6 +295,7 @@ class File
             $this->name = $info['filename'];
             $this->name = $info['filename'];
             $this->ext  = $info['extension'];
             $this->ext  = $info['extension'];
             $this->size = \filesize($path);
             $this->size = \filesize($path);
+
             return true;
             return true;
         } else {
         } else {
             return false;
             return false;

+ 8 - 0
app/Core/Files.php

@@ -187,6 +187,7 @@ class Files
             } else {
             } else {
                 $type = 0;
                 $type = 0;
             }
             }
+
             return $this->imageType[$type] ?? null;
             return $this->imageType[$type] ?? null;
         }
         }
 
 
@@ -206,6 +207,7 @@ class Files
 
 
         if (! isset($file['tmp_name'], $file['name'], $file['type'], $file['error'], $file['size'])) {
         if (! isset($file['tmp_name'], $file['name'], $file['type'], $file['error'], $file['size'])) {
             $this->error = 'Expected file description array';
             $this->error = 'Expected file description array';
+
             return false;
             return false;
         }
         }
 
 
@@ -234,6 +236,7 @@ class Files
 
 
                 $result[] = $cur;
                 $result[] = $cur;
             }
             }
+
             return empty($result) ? null : $result;
             return empty($result) ? null : $result;
         } else {
         } else {
             return '' === $file['name'] && empty($file['size']) ? null : $this->uploadOneFile($file);
             return '' === $file['name'] && empty($file['size']) ? null : $this->uploadOneFile($file);
@@ -276,11 +279,13 @@ class Files
                     $this->error = 'Unknown upload error';
                     $this->error = 'Unknown upload error';
                     break;
                     break;
             }
             }
+
             return false;
             return false;
         }
         }
 
 
         if (! \is_uploaded_file($file['tmp_name'])) {
         if (! \is_uploaded_file($file['tmp_name'])) {
             $this->error = 'The specified file was not uploaded';
             $this->error = 'The specified file was not uploaded';
+
             return false;
             return false;
         }
         }
 
 
@@ -302,11 +307,13 @@ class Files
         if ($isImage) {
         if ($isImage) {
             if ($file['size'] > $this->maxImgSize) {
             if ($file['size'] > $this->maxImgSize) {
                 $this->error = 'The image too large';
                 $this->error = 'The image too large';
+
                 return false;
                 return false;
             }
             }
         } else {
         } else {
             if ($file['size'] > $this->maxFileSize) {
             if ($file['size'] > $this->maxFileSize) {
                 $this->error = 'The file too large';
                 $this->error = 'The file too large';
+
                 return false;
                 return false;
             }
             }
         }
         }
@@ -327,6 +334,7 @@ class Files
             }
             }
         } catch (FileException $e) {
         } catch (FileException $e) {
             $this->error = $e->getMessage();
             $this->error = $e->getMessage();
+
             return false;
             return false;
         }
         }
     }
     }

+ 4 - 0
app/Core/Func.php

@@ -51,6 +51,7 @@ class Func
         if (! \is_array($this->styles)) {
         if (! \is_array($this->styles)) {
             $this->styles = $this->getFoldersWithFile($this->c->DIR_PUBLIC . '/style', 'style.css');
             $this->styles = $this->getFoldersWithFile($this->c->DIR_PUBLIC . '/style', 'style.css');
         }
         }
+
         return $this->styles;
         return $this->styles;
     }
     }
 
 
@@ -64,6 +65,7 @@ class Func
         if (! \is_array($this->langs)) {
         if (! \is_array($this->langs)) {
             $this->langs = $this->getFoldersWithFile($this->c->DIR_LANG, 'common.po');
             $this->langs = $this->getFoldersWithFile($this->c->DIR_LANG, 'common.po');
         }
         }
+
         return $this->langs;
         return $this->langs;
     }
     }
 
 
@@ -114,6 +116,7 @@ class Func
             \closedir($dh);
             \closedir($dh);
             \asort($result, \SORT_NATURAL);
             \asort($result, \SORT_NATURAL);
         }
         }
+
         return $result;
         return $result;
     }
     }
 
 
@@ -201,6 +204,7 @@ class Func
                 ];
                 ];
             }
             }
         }
         }
+
         return $pages;
         return $pages;
     }
     }
 
 

+ 2 - 0
app/Core/Image.php

@@ -157,11 +157,13 @@ class Image extends File
                 break;
                 break;
             default:
             default:
                 $this->error = 'File type not supported';
                 $this->error = 'File type not supported';
+
                 return false;
                 return false;
         }
         }
 
 
         if (! $result) {
         if (! $result) {
             $this->error = 'Error writing file';
             $this->error = 'Error writing file';
+
             return false;
             return false;
         }
         }
         @\chmod($path, 0644);
         @\chmod($path, 0644);

+ 1 - 0
app/Core/Lang.php

@@ -268,6 +268,7 @@ class Lang
         ) {
         ) {
             $line = \substr($line, 1, -1);
             $line = \substr($line, 1, -1);
         }
         }
+
         return \str_replace(
         return \str_replace(
             ['\\n', '\\t', '\\"', '\\\\'],
             ['\\n', '\\t', '\\"', '\\\\'],
             ["\n",  "\t",  '"',  '\\'],
             ["\n",  "\t",  '"',  '\\'],

+ 15 - 0
app/Core/Mail.php

@@ -174,6 +174,7 @@ class Mail
         $this->to = [];
         $this->to = [];
         $this->headers = [];
         $this->headers = [];
         $this->message = null;
         $this->message = null;
+
         return $this;
         return $this;
     }
     }
 
 
@@ -187,6 +188,7 @@ class Mail
     public function setSubject(string $subject): self
     public function setSubject(string $subject): self
     {
     {
         $this->headers['Subject'] = $this->encodeText(\preg_replace('%[\x00-\x1F]%', '', \trim($subject)));
         $this->headers['Subject'] = $this->encodeText(\preg_replace('%[\x00-\x1F]%', '', \trim($subject)));
+
         return $this;
         return $this;
     }
     }
 
 
@@ -209,6 +211,7 @@ class Mail
                 $this->to[] = $this->formatAddress($cur, $name);
                 $this->to[] = $this->formatAddress($cur, $name);
             }
             }
         }
         }
+
         return $this;
         return $this;
     }
     }
 
 
@@ -223,6 +226,7 @@ class Mail
     public function setTo($email, string $name = null): self
     public function setTo($email, string $name = null): self
     {
     {
         $this->to = [];
         $this->to = [];
+
         return $this->addTo($email, $name);
         return $this->addTo($email, $name);
     }
     }
 
 
@@ -240,6 +244,7 @@ class Mail
         if (false !== $email) {
         if (false !== $email) {
             $this->headers['From'] = $this->formatAddress($email, $name);
             $this->headers['From'] = $this->formatAddress($email, $name);
         }
         }
+
         return $this;
         return $this;
     }
     }
 
 
@@ -257,6 +262,7 @@ class Mail
         if (false !== $email) {
         if (false !== $email) {
             $this->headers['Reply-To'] = $this->formatAddress($email, $name);
             $this->headers['Reply-To'] = $this->formatAddress($email, $name);
         }
         }
+
         return $this;
         return $this;
     }
     }
 
 
@@ -277,6 +283,7 @@ class Mail
             return $email;
             return $email;
         } else {
         } else {
             $name = $this->encodeText($this->filterName($name));
             $name = $this->encodeText($this->filterName($name));
+
             return \sprintf('"%s" <%s>', $name, $email);
             return \sprintf('"%s" <%s>', $name, $email);
         }
         }
     }
     }
@@ -319,6 +326,7 @@ class Mail
     public function setFolder(string $folder): self
     public function setFolder(string $folder): self
     {
     {
         $this->folder = $folder;
         $this->folder = $folder;
+
         return $this;
         return $this;
     }
     }
 
 
@@ -332,6 +340,7 @@ class Mail
     public function setLanguage(string $language): self
     public function setLanguage(string $language): self
     {
     {
         $this->language = $language;
         $this->language = $language;
+
         return $this;
         return $this;
     }
     }
 
 
@@ -360,6 +369,7 @@ class Mail
             throw new MailException('The template is empty (' . $file . ').');
             throw new MailException('The template is empty (' . $file . ').');
         }
         }
         $this->setSubject(\substr($subject, 8));
         $this->setSubject(\substr($subject, 8));
+
         return $this->setMessage($tpl);
         return $this->setMessage($tpl);
     }
     }
 
 
@@ -376,6 +386,7 @@ class Mail
                          \str_replace(["\r\n", "\n", "\r"], "\0",
                          \str_replace(["\r\n", "\n", "\r"], "\0",
                          \str_replace("\0", '', \trim($message))));
                          \str_replace("\0", '', \trim($message))));
 //        $this->message = wordwrap ($this->message, 75, $this->EOL, false);
 //        $this->message = wordwrap ($this->message, 75, $this->EOL, false);
+
         return $this;
         return $this;
     }
     }
 
 
@@ -428,6 +439,7 @@ class Mail
         $headers = $this->headers;
         $headers = $this->headers;
         unset($headers['Subject']);
         unset($headers['Subject']);
         $headers = $this->strHeaders($headers);
         $headers = $this->strHeaders($headers);
+
         return @\mail($to, $subject, $this->message, $headers);
         return @\mail($to, $subject, $this->message, $headers);
     }
     }
 
 
@@ -444,6 +456,7 @@ class Mail
             $value = $key . ': ' . $value;
             $value = $key . ': ' . $value;
         }
         }
         unset($value);
         unset($value);
+
         return \implode($this->EOL, $headers);
         return \implode($this->EOL, $headers);
     }
     }
 
 
@@ -478,6 +491,7 @@ class Mail
             $this->smtpData('To: ' . $to . $this->EOL . $headers . $message, '250');
             $this->smtpData('To: ' . $to . $this->EOL . $headers . $message, '250');
             $this->smtpData('NOOP', '250');
             $this->smtpData('NOOP', '250');
         }
         }
+
         return true;
         return true;
     }
     }
 
 
@@ -549,6 +563,7 @@ class Mail
         ) {
         ) {
             throw new SmtpException('Unable to send email. Response of mail server: "' . $get . '"');
             throw new SmtpException('Unable to send email. Response of mail server: "' . $get . '"');
         }
         }
+
         return $return;
         return $return;
     }
     }
 
 

+ 1 - 0
app/Core/Parser.php

@@ -75,6 +75,7 @@ class Parser extends Parserus
         if ('quote' == $bb['tag']) {
         if ('quote' == $bb['tag']) {
             $bb['self nesting'] = (int) $this->c->config->o_quote_depth;
             $bb['self nesting'] = (int) $this->c->config->o_quote_depth;
         }
         }
+
         return parent::addBBCode($bb);
         return parent::addBBCode($bb);
     }
     }
 
 

+ 42 - 8
app/Core/Router.php

@@ -190,14 +190,18 @@ class Router
                 || empty($this->methods['GET'])
                 || empty($this->methods['GET'])
             )
             )
         ) {
         ) {
-            return [self::NOT_IMPLEMENTED];
+            return [
+                self::NOT_IMPLEMENTED,
+            ];
         }
         }
 
 
         if ($this->length) {
         if ($this->length) {
             if (0 === \strpos($uri, $this->prefix)) {
             if (0 === \strpos($uri, $this->prefix)) {
                 $uri = \substr($uri, $this->length);
                 $uri = \substr($uri, $this->length);
             } else {
             } else {
-                return [self::NOT_FOUND];
+                return [
+                    self::NOT_FOUND,
+                ];
             }
             }
         }
         }
 
 
@@ -206,13 +210,25 @@ class Router
         if (isset($this->statical[$uri])) {
         if (isset($this->statical[$uri])) {
             if (isset($this->statical[$uri][$method])) {
             if (isset($this->statical[$uri][$method])) {
                 list($handler, $marker) = $this->statical[$uri][$method];
                 list($handler, $marker) = $this->statical[$uri][$method];
-                return [self::OK, $handler, [], $marker];
+
+                return [
+                    self::OK,
+                    $handler,
+                    [],
+                    $marker,
+                ];
             } elseif (
             } elseif (
                 $head
                 $head
                 && isset($this->statical[$uri]['GET'])
                 && isset($this->statical[$uri]['GET'])
             ) {
             ) {
                 list($handler, $marker) = $this->statical[$uri]['GET'];
                 list($handler, $marker) = $this->statical[$uri]['GET'];
-                return [self::OK, $handler, [], $marker];
+
+                return [
+                    self::OK,
+                    $handler,
+                    [],
+                    $marker,
+                ];
             } else {
             } else {
                 $allowed = \array_keys($this->statical[$uri]);
                 $allowed = \array_keys($this->statical[$uri]);
             }
             }
@@ -247,13 +263,24 @@ class Router
                             : null;
                             : null;
                     }
                     }
                 }
                 }
-                return [self::OK, $handler, $args, $marker];
+
+                return [
+                    self::OK,
+                    $handler,
+                    $args,
+                    $marker,
+                ];
             }
             }
         }
         }
         if (empty($allowed)) {
         if (empty($allowed)) {
-            return [self::NOT_FOUND];
+            return [
+                self::NOT_FOUND,
+            ];
         } else {
         } else {
-            return [self::METHOD_NOT_ALLOWED, $allowed];
+            return [
+                self::METHOD_NOT_ALLOWED,
+                $allowed,
+            ];
         }
         }
     }
     }
 
 
@@ -422,6 +449,13 @@ class Router
             return null;
             return null;
         }
         }
         $pattern .= '$%D';
         $pattern .= '$%D';
-        return [$base, $pattern, $args, $temp, $argsReq];
+
+        return [
+            $base,
+            $pattern,
+            $args,
+            $temp,
+            $argsReq,
+        ];
     }
     }
 }
 }

+ 2 - 0
app/Core/Secury.php

@@ -63,6 +63,7 @@ class Secury
         if (empty($key)) {
         if (empty($key)) {
             throw new InvalidArgumentException('Key can not be empty');
             throw new InvalidArgumentException('Key can not be empty');
         }
         }
+
         return \hash_hmac($this->hmac['algo'], $data, $key . $this->hmac['salt']);
         return \hash_hmac($this->hmac['algo'], $data, $key . $this->hmac['salt']);
     }
     }
 
 
@@ -94,6 +95,7 @@ class Secury
         for ($i = 0; $i < $len; ++$i) {
         for ($i = 0; $i < $len; ++$i) {
             $result .= $chars[\ord($key[$i]) % 64];
             $result .= $chars[\ord($key[$i]) % 64];
         }
         }
+
         return $result;
         return $result;
     }
     }
 
 

+ 36 - 7
app/Core/Validator.php

@@ -136,6 +136,7 @@ class Validator
         $this->errors    = [];
         $this->errors    = [];
         $this->fields    = [];
         $this->fields    = [];
         $this->status    = [];
         $this->status    = [];
+
         return $this;
         return $this;
     }
     }
 
 
@@ -149,6 +150,7 @@ class Validator
     public function addValidators(array $validators): self
     public function addValidators(array $validators): self
     {
     {
         $this->validators = \array_replace($this->validators, $validators);
         $this->validators = \array_replace($this->validators, $validators);
+
         return $this;
         return $this;
     }
     }
 
 
@@ -200,6 +202,7 @@ class Validator
             }
             }
             $this->fields[$field] = $field;
             $this->fields[$field] = $field;
         }
         }
+
         return $this;
         return $this;
     }
     }
 
 
@@ -213,6 +216,7 @@ class Validator
     public function addArguments(array $arguments): self
     public function addArguments(array $arguments): self
     {
     {
         $this->arguments = \array_replace($this->arguments, $arguments);
         $this->arguments = \array_replace($this->arguments, $arguments);
+
         return $this;
         return $this;
     }
     }
 
 
@@ -226,6 +230,7 @@ class Validator
     public function addMessages(array $messages): self
     public function addMessages(array $messages): self
     {
     {
         $this->messages = \array_replace($this->messages, $messages);
         $this->messages = \array_replace($this->messages, $messages);
+
         return $this;
         return $this;
     }
     }
 
 
@@ -239,6 +244,7 @@ class Validator
     public function addAliases(array $aliases): self
     public function addAliases(array $aliases): self
     {
     {
         $this->aliases = \array_replace($this->aliases, $aliases);
         $this->aliases = \array_replace($this->aliases, $aliases);
+
         return $this;
         return $this;
     }
     }
 
 
@@ -264,6 +270,7 @@ class Validator
             $this->__get($field);
             $this->__get($field);
         }
         }
         $this->raw     = null;
         $this->raw     = null;
+
         return empty($this->errors);
         return empty($this->errors);
     }
     }
 
 
@@ -359,6 +366,7 @@ class Validator
                 break;
                 break;
             }
             }
         }
         }
+
         return $value;
         return $value;
     }
     }
 
 
@@ -379,6 +387,7 @@ class Validator
         // нет ошибки, для выхода из цикла проверки правил
         // нет ошибки, для выхода из цикла проверки правил
         if (true === $error) {
         if (true === $error) {
             $this->error = false;
             $this->error = false;
+
             return;
             return;
         }
         }
 
 
@@ -432,6 +441,7 @@ class Validator
         if (! isset($this->status[$field])) {
         if (! isset($this->status[$field])) {
             $this->__get($field);
             $this->__get($field);
         }
         }
+
         return $this->status[$field];
         return $this->status[$field];
     }
     }
 
 
@@ -506,6 +516,7 @@ class Validator
             return $value;
             return $value;
         }
         }
         $this->addError('The :alias is required');
         $this->addError('The :alias is required');
+
         return null;
         return null;
     }
     }
 
 
@@ -519,14 +530,8 @@ class Validator
         if (null === $value) {                       // если данное поле отсутствует,
         if (null === $value) {                       // если данное поле отсутствует,
             $this->addError(true);                   // то прерываем его проверку
             $this->addError(true);                   // то прерываем его проверку
         }
         }
-        return $value;
 
 
-#        list(, $error) = $this->vRequired($v, $value);
-#        if (false === $error) {
-#            return [null, 'The :alias is not required'];
-#        } else {
-#            return [$value, true];
-#        }
+        return $value;
     }
     }
 
 
     protected function vString(Validator $v, $value, $attr)
     protected function vString(Validator $v, $value, $attr)
@@ -558,6 +563,7 @@ class Validator
             return $value;
             return $value;
         } else {
         } else {
             $this->addError('The :alias must be string');
             $this->addError('The :alias must be string');
+
             return null;
             return null;
         }
         }
     }
     }
@@ -570,6 +576,7 @@ class Validator
             return 0.0 + $value;
             return 0.0 + $value;
         } else {
         } else {
             $this->addError('The :alias must be numeric');
             $this->addError('The :alias must be numeric');
+
             return null;
             return null;
         }
         }
     }
     }
@@ -585,6 +592,7 @@ class Validator
             return (int) $value;
             return (int) $value;
         } else {
         } else {
             $this->addError('The :alias must be integer');
             $this->addError('The :alias must be integer');
+
             return null;
             return null;
         }
         }
     }
     }
@@ -596,6 +604,7 @@ class Validator
             && ! \is_array($value)
             && ! \is_array($value)
         ) {
         ) {
             $this->addError('The :alias must be array');
             $this->addError('The :alias must be array');
+
             return null;
             return null;
         } elseif (! $attr) {
         } elseif (! $attr) {
             return $value;
             return $value;
@@ -609,6 +618,7 @@ class Validator
         foreach ($attr as $name => $rules) {
         foreach ($attr as $name => $rules) {
             $this->recArray($value, $result, $name, $rules, $vars['field'] . '.' . $name);
             $this->recArray($value, $result, $name, $rules, $vars['field'] . '.' . $name);
         }
         }
+
         return $result;
         return $result;
     }
     }
 
 
@@ -669,8 +679,10 @@ class Validator
             }
             }
         } elseif (null !== $value) {
         } elseif (null !== $value) {
             $this->addError('The :alias minimum is :attr');
             $this->addError('The :alias minimum is :attr');
+
             return null;
             return null;
         }
         }
+
         return $value;
         return $value;
     }
     }
 
 
@@ -700,6 +712,7 @@ class Validator
                 foreach ($value as $file) {
                 foreach ($value as $file) {
                     if ($file->size() > $attr) {
                     if ($file->size() > $attr) {
                         $this->addError('The :alias contains too large a file');
                         $this->addError('The :alias contains too large a file');
+
                         return null;
                         return null;
                     }
                     }
                 }
                 }
@@ -709,12 +722,15 @@ class Validator
         } elseif ($value instanceof File) {
         } elseif ($value instanceof File) {
             if ($value->size() > $attr * 1024) {
             if ($value->size() > $attr * 1024) {
                 $this->addError('The :alias contains too large a file');
                 $this->addError('The :alias contains too large a file');
+
                 return null;
                 return null;
             }
             }
         } elseif (null !== $value) {
         } elseif (null !== $value) {
             $this->addError('The :alias maximum is :attr'); //????
             $this->addError('The :alias maximum is :attr'); //????
+
             return null;
             return null;
         }
         }
+
         return $value;
         return $value;
     }
     }
 
 
@@ -744,6 +760,7 @@ class Validator
         if (! \is_array($args)) {
         if (! \is_array($args)) {
             $args = [];
             $args = [];
         }
         }
+
         return $this->c->Router->validate($value, $attr, $args);
         return $this->c->Router->validate($value, $attr, $args);
     }
     }
 
 
@@ -756,6 +773,7 @@ class Validator
             return $value;
             return $value;
         } else {
         } else {
             $this->addError('The :alias must be same with original');
             $this->addError('The :alias must be same with original');
+
             return null;
             return null;
         }
         }
     }
     }
@@ -770,6 +788,7 @@ class Validator
             )
             )
         ) {
         ) {
             $this->addError('The :alias is not valid format');
             $this->addError('The :alias is not valid format');
+
             return null;
             return null;
         } else {
         } else {
             return $value;
             return $value;
@@ -789,6 +808,7 @@ class Validator
         ) {
         ) {
             $this->addError('The :alias contains an invalid value');
             $this->addError('The :alias contains an invalid value');
         }
         }
+
         return $value;
         return $value;
     }
     }
 
 
@@ -811,6 +831,7 @@ class Validator
         }
         }
         if (! \is_array($value)) {
         if (! \is_array($value)) {
             $this->addError('The :alias not contains file');
             $this->addError('The :alias not contains file');
+
             return null;
             return null;
         }
         }
         $value = $this->c->Files->upload($value);
         $value = $this->c->Files->upload($value);
@@ -818,6 +839,7 @@ class Validator
             return null;
             return null;
         } elseif (false === $value) {
         } elseif (false === $value) {
             $this->addError($this->c->Files->error());
             $this->addError($this->c->Files->error());
+
             return null;
             return null;
         } elseif ('multiple' === $attr) {
         } elseif ('multiple' === $attr) {
             if (! \is_array($value)) {
             if (! \is_array($value)) {
@@ -825,8 +847,10 @@ class Validator
             }
             }
         } elseif (\is_array($value)) {
         } elseif (\is_array($value)) {
             $this->addError('The :alias contains more than one file');
             $this->addError('The :alias contains more than one file');
+
             return null;
             return null;
         }
         }
+
         return $value;
         return $value;
     }
     }
 
 
@@ -838,6 +862,7 @@ class Validator
             foreach ($value as $file) {
             foreach ($value as $file) {
                 if (null === $this->c->Files->isImage($file)) {
                 if (null === $this->c->Files->isImage($file)) {
                     $this->addError('The :alias not contains image');
                     $this->addError('The :alias not contains image');
+
                     return null;
                     return null;
                 }
                 }
             }
             }
@@ -846,8 +871,10 @@ class Validator
             && null === $this->c->Files->isImage($value)
             && null === $this->c->Files->isImage($value)
         ) {
         ) {
             $this->addError('The :alias not contains image');
             $this->addError('The :alias not contains image');
+
             return null;
             return null;
         }
         }
+
         return $value;
         return $value;
     }
     }
 
 
@@ -860,8 +887,10 @@ class Validator
             || false === \strtotime($value . ' UTC')
             || false === \strtotime($value . ' UTC')
         ) {
         ) {
             $v->addError('The :alias does not contain a date');
             $v->addError('The :alias does not contain a date');
+
             return \is_string($value) ? $value : null;
             return \is_string($value) ? $value : null;
         }
         }
+
         return $value;
         return $value;
     }
     }
 }
 }

+ 2 - 0
app/Core/View.php

@@ -64,6 +64,7 @@ EOD;
         if (false === \strpos($value, '<!-- inline -->')) {
         if (false === \strpos($value, '<!-- inline -->')) {
             return $perfix . $value;
             return $perfix . $value;
         }
         }
+
         return $perfix . \preg_replace_callback(
         return $perfix . \preg_replace_callback(
             '%<!-- inline -->([^<]*(?:<(?!!-- endinline -->)[^<]*)*+)(?:<!-- endinline -->)?%',
             '%<!-- inline -->([^<]*(?:<(?!!-- endinline -->)[^<]*)*+)(?:<!-- endinline -->)?%',
             function ($matches) {
             function ($matches) {
@@ -105,6 +106,7 @@ EOD;
             require($this->prepare($_name));
             require($this->prepare($_name));
             $this->endBlock(true);
             $this->endBlock(true);
         }
         }
+
         return $this->block('content');
         return $this->block('content');
     }
     }
 
 

+ 1 - 0
app/Models/Action.php

@@ -39,6 +39,7 @@ class Action
     public function setManager(ManagerModel $manager): self
     public function setManager(ManagerModel $manager): self
     {
     {
         $this->manager = $manager;
         $this->manager = $manager;
+
         return $this;
         return $this;
     }
     }
 }
 }

+ 2 - 0
app/Models/AdminList/Model.php

@@ -19,6 +19,7 @@ class Model extends ParentModel
             $this->list = \array_flip($this->c->users->adminsIds());
             $this->list = \array_flip($this->c->users->adminsIds());
             $this->c->Cache->set('admins', $this->list);
             $this->c->Cache->set('admins', $this->list);
         }
         }
+
         return $this;
         return $this;
     }
     }
 
 
@@ -30,6 +31,7 @@ class Model extends ParentModel
     public function reset(): self
     public function reset(): self
     {
     {
         $this->c->Cache->delete('admins');
         $this->c->Cache->delete('admins');
+
         return $this;
         return $this;
     }
     }
 }
 }

+ 1 - 3
app/Models/BanList/Filter.php

@@ -109,8 +109,6 @@ class Filter extends Method
                 ORDER BY {$orderBy}";
                 ORDER BY {$orderBy}";
         }
         }
 
 
-        $ids = $this->c->DB->query($query, $vars)->fetchAll(PDO::FETCH_COLUMN);
-
-        return $ids;
+        return $this->c->DB->query($query, $vars)->fetchAll(PDO::FETCH_COLUMN);
     }
     }
 }
 }

+ 1 - 0
app/Models/BanList/Load.php

@@ -83,6 +83,7 @@ class Load extends Method
             'emailList' => $emailList,
             'emailList' => $emailList,
             'ipList'    => $ipList,
             'ipList'    => $ipList,
         ]);
         ]);
+
         return $this->model;
         return $this->model;
     }
     }
 }
 }

+ 1 - 0
app/Models/Censorship/Model.php

@@ -22,6 +22,7 @@ class Model extends ParentModel
                 $this->refresh();
                 $this->refresh();
             }
             }
         }
         }
+
         return $this;
         return $this;
     }
     }
 
 

+ 1 - 0
app/Models/Censorship/Refresh.php

@@ -30,6 +30,7 @@ class Refresh extends Method
             'searchList'  => $search,
             'searchList'  => $search,
             'replaceList' => $replace,
             'replaceList' => $replace,
         ]);
         ]);
+
         return $this->model;
         return $this->model;
     }
     }
 }
 }

+ 1 - 0
app/Models/Config/Install.php

@@ -15,6 +15,7 @@ class Install extends Method
     public function install(): Config
     public function install(): Config
     {
     {
         $this->model->setAttrs($this->c->forConfig);
         $this->model->setAttrs($this->c->forConfig);
+
         return $this->model;
         return $this->model;
     }
     }
 }
 }

+ 1 - 0
app/Models/Config/Load.php

@@ -19,6 +19,7 @@ class Load extends Method
         $config = $this->c->DB->query('SELECT cf.conf_name, cf.conf_value FROM ::config AS cf')->fetchAll(PDO::FETCH_KEY_PAIR);
         $config = $this->c->DB->query('SELECT cf.conf_name, cf.conf_value FROM ::config AS cf')->fetchAll(PDO::FETCH_KEY_PAIR);
         $this->model->setAttrs($config);
         $this->model->setAttrs($config);
         $this->c->Cache->set('config', $config);
         $this->c->Cache->set('config', $config);
+
         return $this->model;
         return $this->model;
     }
     }
 }
 }

+ 1 - 0
app/Models/Config/Model.php

@@ -18,6 +18,7 @@ class Model extends DataModel
         } else {
         } else {
             $this->load();
             $this->load();
         }
         }
+
         return $this;
         return $this;
     }
     }
 }
 }

+ 1 - 0
app/Models/Config/Save.php

@@ -52,6 +52,7 @@ class Save extends Method
             }
             }
         }
         }
         $this->c->Cache->delete('config');
         $this->c->Cache->delete('config');
+
         return $this->model;
         return $this->model;
     }
     }
 }
 }

+ 3 - 0
app/Models/Cookie/Model.php

@@ -67,6 +67,7 @@ class Model extends ParentModel
         if ($result) {
         if ($result) {
             $_COOKIE[$this->prefix . $name] = $value;
             $_COOKIE[$this->prefix . $name] = $value;
         }
         }
+
         return $result;
         return $result;
     }
     }
 
 
@@ -81,6 +82,7 @@ class Model extends ParentModel
     public function get(string $name, $default = null)
     public function get(string $name, $default = null)
     {
     {
         $name = $this->prefix . $name;
         $name = $this->prefix . $name;
+
         return isset($_COOKIE[$name])
         return isset($_COOKIE[$name])
             ? $this->c->Secury->replInvalidChars($_COOKIE[$name])
             ? $this->c->Secury->replInvalidChars($_COOKIE[$name])
             : $default;
             : $default;
@@ -101,6 +103,7 @@ class Model extends ParentModel
         if ($result) {
         if ($result) {
             unset($_COOKIE[$this->prefix . $name]);
             unset($_COOKIE[$this->prefix . $name]);
         }
         }
+
         return $result;
         return $result;
     }
     }
 
 

+ 2 - 0
app/Models/DBMap/Model.php

@@ -20,6 +20,7 @@ class Model extends ParentModel
             $this->c->Cache->set('db_map', $map);
             $this->c->Cache->set('db_map', $map);
             $this->setAttrs($map);
             $this->setAttrs($map);
         }
         }
+
         return $this;
         return $this;
     }
     }
 
 
@@ -31,6 +32,7 @@ class Model extends ParentModel
     public function reset(): self
     public function reset(): self
     {
     {
         $this->c->Cache->delete('db_map');
         $this->c->Cache->delete('db_map');
+
         return $this;
         return $this;
     }
     }
 }
 }

+ 3 - 0
app/Models/Forum/Manager.php

@@ -59,6 +59,7 @@ class Manager extends ManagerModel
         }
         }
 
 
         $this->forumList = $list;
         $this->forumList = $list;
+
         return $this;
         return $this;
     }
     }
 
 
@@ -107,6 +108,7 @@ class Manager extends ManagerModel
     {
     {
         $id = $this->Save->insert($forum);
         $id = $this->Save->insert($forum);
         $this->set($id, $forum);
         $this->set($id, $forum);
+
         return $id;
         return $id;
     }
     }
 
 
@@ -128,6 +130,7 @@ class Manager extends ManagerModel
 
 
             $list = $this->depthList($sub, $depth, $list);
             $list = $this->depthList($sub, $depth, $list);
         }
         }
+
         return $list;
         return $list;
     }
     }
 }
 }

+ 13 - 5
app/Models/Forum/Model.php

@@ -38,6 +38,7 @@ class Model extends DataModel
     protected function getcanCreateTopic(): bool
     protected function getcanCreateTopic(): bool
     {
     {
         $user = $this->c->user;
         $user = $this->c->user;
+
         return 1 == $this->post_topics
         return 1 == $this->post_topics
             || (
             || (
                 null === $this->post_topics
                 null === $this->post_topics
@@ -212,10 +213,13 @@ class Model extends DataModel
         if ('1' == $this->c->user->g_view_users) {
         if ('1' == $this->c->user->g_view_users) {
             foreach($attr as $id => &$cur) {
             foreach($attr as $id => &$cur) {
                 $cur = [
                 $cur = [
-                    $this->c->Router->link('User', [
-                        'id'   => $id,
-                        'name' => $cur,
-                    ]),
+                    $this->c->Router->link(
+                        'User',
+                        [
+                            'id'   => $id,
+                            'name' => $cur,
+                        ]
+                    ),
                     $cur,
                     $cur,
                 ];
                 ];
             }
             }
@@ -319,6 +323,7 @@ class Model extends DataModel
 
 
             $this->setAttr('tree', $attr);
             $this->setAttr('tree', $attr);
         }
         }
+
         return $attr;
         return $attr;
     }
     }
 
 
@@ -349,7 +354,10 @@ class Model extends DataModel
             $this->numPages,
             $this->numPages,
             $this->page,
             $this->page,
             'Forum',
             'Forum',
-            ['id' => $this->id, 'name' => $this->forum_name]
+            [
+                'id'   => $this->id,
+                'name' => $this->forum_name,
+            ]
         );
         );
     }
     }
 
 

+ 3 - 0
app/Models/Forum/Refresh.php

@@ -58,6 +58,7 @@ class Refresh extends Action
             'time' => \time(),
             'time' => \time(),
             'list' => $this->list,
             'list' => $this->list,
         ]);
         ]);
+
         return $this->list;
         return $this->list;
     }
     }
 
 
@@ -71,6 +72,7 @@ class Refresh extends Action
     protected function formatModers(string $str): ?array
     protected function formatModers(string $str): ?array
     {
     {
         $moderators = \json_decode($str, true);
         $moderators = \json_decode($str, true);
+
         return $moderators ?: null;
         return $moderators ?: null;
     }
     }
 
 
@@ -110,6 +112,7 @@ class Refresh extends Action
         $this->list[$parent] = \array_filter($list[$parent], function($val) {
         $this->list[$parent] = \array_filter($list[$parent], function($val) {
             return null !== $val;
             return null !== $val;
         });
         });
+
         return $all;
         return $all;
     }
     }
 }
 }

+ 2 - 0
app/Models/Group/Manager.php

@@ -44,6 +44,7 @@ class Manager extends ManagerModel
             }
             }
             $this->flag = true;
             $this->flag = true;
         }
         }
+
         return $this;
         return $this;
     }
     }
 
 
@@ -84,6 +85,7 @@ class Manager extends ManagerModel
     {
     {
         $id = $this->Save->insert($group);
         $id = $this->Save->insert($group);
         $this->set($id, $group);
         $this->set($id, $group);
+
         return $id;
         return $id;
     }
     }
 }
 }

+ 1 - 0
app/Models/Group/Model.php

@@ -24,6 +24,7 @@ class Model extends DataModel
             $this->c->GROUP_GUEST,
             $this->c->GROUP_GUEST,
             $this->c->GROUP_MEMBER
             $this->c->GROUP_MEMBER
         ];
         ];
+
         return ! \in_array($this->g_id, $notDeleted) && $this->g_id != $this->c->config->o_default_user_group;
         return ! \in_array($this->g_id, $notDeleted) && $this->g_id != $this->c->config->o_default_user_group;
     }
     }
 
 

+ 1 - 0
app/Models/Method.php

@@ -39,6 +39,7 @@ class Method
     public function setModel(Model $model): self
     public function setModel(Model $model): self
     {
     {
         $this->model = $model;
         $this->model = $model;
+
         return $this;
         return $this;
     }
     }
 }
 }

+ 6 - 0
app/Models/Page.php

@@ -177,6 +177,7 @@ abstract class Page extends Model
                }
                }
             }
             }
         }
         }
+
         return $nav;
         return $nav;
     }
     }
 
 
@@ -214,6 +215,7 @@ abstract class Page extends Model
             $titles = $this->titles;
             $titles = $this->titles;
         }
         }
         $titles[] = $this->c->config->o_board_title;
         $titles[] = $this->c->config->o_board_title;
+
         return \implode(__('Title separator'), $titles);
         return \implode(__('Title separator'), $titles);
     }
     }
 
 
@@ -242,6 +244,7 @@ abstract class Page extends Model
                 $headers[] = ['style', $style];
                 $headers[] = ['style', $style];
             }
             }
         }
         }
+
         return $headers;
         return $headers;
     }
     }
 
 
@@ -258,6 +261,7 @@ abstract class Page extends Model
         $attr = $this->getAttr('pageHeaders', []);
         $attr = $this->getAttr('pageHeaders', []);
         $attr['style'][$name] = $value;
         $attr['style'][$name] = $value;
         $this->setAttr('pageHeaders', $attr);
         $this->setAttr('pageHeaders', $attr);
+
         return $this;
         return $this;
     }
     }
 
 
@@ -284,6 +288,7 @@ abstract class Page extends Model
         $attr   = $this->getAttr('httpHeaders', []);
         $attr   = $this->getAttr('httpHeaders', []);
         $attr[] = ["{$key} {$value}", $replace];
         $attr[] = ["{$key} {$value}", $replace];
         $this->setAttr('httpHeaders', $attr);
         $this->setAttr('httpHeaders', $attr);
+
         return $this;
         return $this;
     }
     }
 
 
@@ -326,6 +331,7 @@ abstract class Page extends Model
         if (isset($list[$this->httpStatus])) {
         if (isset($list[$this->httpStatus])) {
             $this->header('HTTP/1.0', $list[$this->httpStatus]);
             $this->header('HTTP/1.0', $list[$this->httpStatus]);
         }
         }
+
         return $this;
         return $this;
     }
     }
 
 

+ 10 - 1
app/Models/Pages/Admin/Bans.php

@@ -38,6 +38,7 @@ class Bans extends Admin
         unset($data['token']);
         unset($data['token']);
         $data = \base64_encode(\json_encode($data));
         $data = \base64_encode(\json_encode($data));
         $hash = $this->c->Secury->hash($data);
         $hash = $this->c->Secury->hash($data);
+
         return "{$data}:{$hash}";
         return "{$data}:{$hash}";
     }
     }
 
 
@@ -401,6 +402,7 @@ class Bans extends Admin
         $number = \count($idsN);
         $number = \count($idsN);
         if (0 == $number) {
         if (0 == $number) {
             $this->fIswev = ['i', __('No bans found')];
             $this->fIswev = ['i', __('No bans found')];
+
             return $this->view([], 'GET', $data);
             return $this->view([], 'GET', $data);
         }
         }
 
 
@@ -427,7 +429,14 @@ class Bans extends Admin
             __('Results head'),
             __('Results head'),
         ];
         ];
         $this->formResult = $this->form($banList, $startNum, $args);
         $this->formResult = $this->form($banList, $startNum, $args);
-        $this->pagination = $this->c->Func->paginate($pages, $page, 'AdminBansResult', ['data' => $args['data']]);
+        $this->pagination = $this->c->Func->paginate(
+            $pages,
+            $page,
+            'AdminBansResult',
+            [
+                'data' => $args['data'],
+            ]
+        );
 
 
         return $this;
         return $this;
     }
     }

+ 1 - 0
app/Models/Pages/Admin/Forums.php

@@ -80,6 +80,7 @@ class Forums extends Admin
                 $max = $f->disp_position;
                 $max = $f->disp_position;
             }
             }
         }
         }
+
         return $max + 1;
         return $max + 1;
     }
     }
 
 

+ 4 - 0
app/Models/Pages/Admin/Groups.php

@@ -152,10 +152,12 @@ class Groups extends Admin
 
 
         if (! $v->validation($_POST)) {
         if (! $v->validation($_POST)) {
             $this->fIswev = $v->getErrors();
             $this->fIswev = $v->getErrors();
+
             return $this->view();
             return $this->view();
         }
         }
         $this->c->config->o_default_user_group = $v->defaultgroup;
         $this->c->config->o_default_user_group = $v->defaultgroup;
         $this->c->config->save();
         $this->c->config->save();
+
         return $this->c->Redirect->page('AdminGroups')->message('Default group redirect');
         return $this->c->Redirect->page('AdminGroups')->message('Default group redirect');
     }
     }
 
 
@@ -186,6 +188,7 @@ class Groups extends Admin
 
 
             if (! $v->validation($_POST)) {
             if (! $v->validation($_POST)) {
                 $this->fIswev = $v->getErrors();
                 $this->fIswev = $v->getErrors();
+
                 return $this->view();
                 return $this->view();
             }
             }
 
 
@@ -424,6 +427,7 @@ class Groups extends Admin
             $form['sets']['group-data'] = [
             $form['sets']['group-data'] = [
                 'fields' => $fieldset,
                 'fields' => $fieldset,
             ];
             ];
+
             return $form;
             return $form;
         }
         }
 
 

+ 6 - 1
app/Models/Pages/Admin/Maintenance.php

@@ -187,6 +187,7 @@ class Maintenance extends Admin
         ) {
         ) {
             $value = __('Default maintenance message');
             $value = __('Default maintenance message');
         }
         }
+
         return $value;
         return $value;
     }
     }
 
 
@@ -226,6 +227,7 @@ class Maintenance extends Admin
             )
             )
         ) {
         ) {
             $this->fIswev = $v->getErrors();
             $this->fIswev = $v->getErrors();
+
             return $this->view([], 'GET');
             return $this->view([], 'GET');
         }
         }
 
 
@@ -247,7 +249,10 @@ class Maintenance extends Admin
                 'start' => $last + 1,
                 'start' => $last + 1,
                 'clear' => $v->clear ? '1' : '0',
                 'clear' => $v->clear ? '1' : '0',
             ];
             ];
-            $args['token'] = $this->c->Csrf->create('AdminRebuildIndex', $args);
+            $args['token'] = $this->c->Csrf->create(
+                'AdminRebuildIndex',
+                $args
+            );
 
 
             return $this->c->Redirect->page('AdminRebuildIndex', $args)->message(__('Processed posts', $v->start, $last));
             return $this->c->Redirect->page('AdminRebuildIndex', $args)->message(__('Processed posts', $v->start, $last));
         } else {
         } else {

+ 2 - 0
app/Models/Pages/Admin/Options.php

@@ -139,6 +139,7 @@ class Options extends Admin
         if ($timeout >= $v->o_timeout_visit) {
         if ($timeout >= $v->o_timeout_visit) {
             $v->addError('Timeout error message');
             $v->addError('Timeout error message');
         }
         }
+
         return $timeout;
         return $timeout;
     }
     }
 
 
@@ -174,6 +175,7 @@ class Options extends Admin
         ) {
         ) {
             $value = 0;
             $value = 0;
         }
         }
+
         return $value;
         return $value;
     }
     }
 
 

+ 14 - 3
app/Models/Pages/Admin/Statistics.php

@@ -33,10 +33,12 @@ class Statistics extends Admin
                         $result = \array_map(
                         $result = \array_map(
                             function($val) {
                             function($val) {
                                 $val = \str_replace('body', '#id-phpinfo-div', $val, $count);
                                 $val = \str_replace('body', '#id-phpinfo-div', $val, $count);
+
                                 return $count ? $val : '#id-phpinfo-div ' . $val;
                                 return $count ? $val : '#id-phpinfo-div ' . $val;
                             },
                             },
                             \explode(',', $match[1])
                             \explode(',', $match[1])
                         );
                         );
+
                         return \implode(', ', $result) . $match[2];
                         return \implode(', ', $result) . $match[2];
                     },
                     },
                     $matches[1]
                     $matches[1]
@@ -49,8 +51,14 @@ class Statistics extends Admin
 
 
         $this->nameTpl    = 'admin/phpinfo';
         $this->nameTpl    = 'admin/phpinfo';
         $this->mainSuffix = '-one-column';
         $this->mainSuffix = '-one-column';
-        $this->aCrumbs[]  = [$this->c->Router->link('AdminInfo'), 'phpinfo()'];
-        $this->aCrumbs[]  = [$this->c->Router->link('AdminStatistics'), __('Server statistics')];
+        $this->aCrumbs[]  = [
+            $this->c->Router->link('AdminInfo'),
+            'phpinfo()',
+        ];
+        $this->aCrumbs[]  = [
+            $this->c->Router->link('AdminStatistics'),
+            __('Server statistics'),
+        ];
         $this->phpinfo    = $phpinfo;
         $this->phpinfo    = $phpinfo;
 
 
         return $this;
         return $this;
@@ -66,7 +74,10 @@ class Statistics extends Admin
         $this->c->Lang->load('admin_index');
         $this->c->Lang->load('admin_index');
 
 
         $this->nameTpl   = 'admin/statistics';
         $this->nameTpl   = 'admin/statistics';
-        $this->aCrumbs[] = [$this->c->Router->link('AdminStatistics'), __('Server statistics')];
+        $this->aCrumbs[] = [
+            $this->c->Router->link('AdminStatistics'),
+            __('Server statistics'),
+        ];
         $this->linkInfo  = $this->c->Router->link('AdminInfo');
         $this->linkInfo  = $this->c->Router->link('AdminInfo');
 
 
         // Get the server load averages (if possible)
         // Get the server load averages (if possible)

+ 9 - 0
app/Models/Pages/Admin/Users.php

@@ -40,6 +40,7 @@ abstract class Users extends Admin
             unset($data['token']);
             unset($data['token']);
             $data = \base64_encode(\json_encode($data));
             $data = \base64_encode(\json_encode($data));
             $hash = $this->c->Secury->hash($data);
             $hash = $this->c->Secury->hash($data);
+
             return "{$data}:{$hash}";
             return "{$data}:{$hash}";
         } else {
         } else {
             return "ip:{$data}";
             return "ip:{$data}";
@@ -63,6 +64,7 @@ abstract class Users extends Admin
 
 
         if ('ip' === $data[0]) {
         if ('ip' === $data[0]) {
             $ip = \filter_var($data[1], \FILTER_VALIDATE_IP);
             $ip = \filter_var($data[1], \FILTER_VALIDATE_IP);
+
             return false === $ip ? false : ['ip' => $ip];
             return false === $ip ? false : ['ip' => $ip];
         }
         }
 
 
@@ -96,6 +98,7 @@ abstract class Users extends Admin
 
 
         if (! empty($bad)) {
         if (! empty($bad)) {
             $this->fIswev = ['v', __('Action not available')];
             $this->fIswev = ['v', __('Action not available')];
+
             return false;
             return false;
         }
         }
 
 
@@ -110,6 +113,7 @@ abstract class Users extends Admin
                 case self::ACTION_BAN:
                 case self::ACTION_BAN:
                     if ($this->c->bans->isBanned($user)) {
                     if ($this->c->bans->isBanned($user)) {
                         $this->fIswev = ['i', __('User is ban', $user->username)];
                         $this->fIswev = ['i', __('User is ban', $user->username)];
+
                         return false;
                         return false;
                     }
                     }
                     if (! $this->c->userRules->canBanUser($user)) {
                     if (! $this->c->userRules->canBanUser($user)) {
@@ -117,6 +121,7 @@ abstract class Users extends Admin
                         if ($user->isAdmMod) {
                         if ($user->isAdmMod) {
                             $this->fIswev = ['i', __('No ban admins message')];
                             $this->fIswev = ['i', __('No ban admins message')];
                         }
                         }
+
                         return false;
                         return false;
                     }
                     }
                     break;
                     break;
@@ -126,6 +131,7 @@ abstract class Users extends Admin
                         if ($user->isAdmMod) {
                         if ($user->isAdmMod) {
                             $this->fIswev = ['i', __('No delete admins message')];
                             $this->fIswev = ['i', __('No delete admins message')];
                         }
                         }
+
                         return false;
                         return false;
                     }
                     }
                     break;
                     break;
@@ -135,11 +141,13 @@ abstract class Users extends Admin
                         if ($user->isAdmin) {
                         if ($user->isAdmin) {
                             $this->fIswev = ['i', __('No move admins message')];
                             $this->fIswev = ['i', __('No move admins message')];
                         }
                         }
+
                         return false;
                         return false;
                     }
                     }
                     break;
                     break;
                 default:
                 default:
                     $this->fIswev = ['v', __('Action not available')];
                     $this->fIswev = ['v', __('Action not available')];
+
                     return false;
                     return false;
             }
             }
 
 
@@ -151,6 +159,7 @@ abstract class Users extends Admin
 
 
         if (empty($result)) {
         if (empty($result)) {
             $this->fIswev = ['v', __('No users selected')];
             $this->fIswev = ['v', __('No users selected')];
+
             return false;
             return false;
         }
         }
 
 

+ 4 - 0
app/Models/Pages/Admin/Users/Action.php

@@ -24,6 +24,7 @@ class Action extends Users
             $result[] = $user->username;
             $result[] = $user->username;
         }
         }
         \sort($result, \SORT_STRING | \SORT_FLAG_CASE);
         \sort($result, \SORT_STRING | \SORT_FLAG_CASE);
+
         return $result;
         return $result;
     }
     }
 
 
@@ -87,6 +88,7 @@ class Action extends Users
         if (false === $ids) {
         if (false === $ids) {
             $message = $this->c->Message->message('Action not available');
             $message = $this->c->Message->message('Action not available');
             $message->fIswev = $this->fIswev; //????
             $message->fIswev = $this->fIswev; //????
+
             return $message;
             return $message;
         }
         }
 
 
@@ -248,6 +250,7 @@ class Action extends Users
         } elseif (! $this->user->isAdmin) {
         } elseif (! $this->user->isAdmin) {
             $list = [$this->c->GROUP_MEMBER => $list[$this->c->GROUP_MEMBER]];
             $list = [$this->c->GROUP_MEMBER => $list[$this->c->GROUP_MEMBER]];
         }
         }
+
         return $list;
         return $list;
     }
     }
 
 
@@ -318,6 +321,7 @@ class Action extends Users
                 } else {
                 } else {
                     $redirect->page('AdminUsers');
                     $redirect->page('AdminUsers');
                 }
                 }
+
                 return $redirect->message('Users move redirect');
                 return $redirect->message('Users move redirect');
 
 
             }
             }

+ 4 - 2
app/Models/Pages/Admin/Users/NewUser.php

@@ -73,8 +73,10 @@ class NewUser extends Users
 
 
         $this->nameTpl    = 'admin/users';
         $this->nameTpl    = 'admin/users';
         $this->formNew    = $this->formNew($data);
         $this->formNew    = $this->formNew($data);
-        $this->aCrumbs[]  = [$this->c->Router->link('AdminUsersNew'), __('Add user')];
-
+        $this->aCrumbs[]  = [
+            $this->c->Router->link('AdminUsersNew'),
+            __('Add user'),
+        ];
 
 
         return $this;
         return $this;
     }
     }

+ 9 - 1
app/Models/Pages/Admin/Users/Result.php

@@ -143,7 +143,14 @@ class Result extends Users
             $crName,
             $crName,
         ];
         ];
         $this->formResult = $this->form($userList, $startNum, $args);
         $this->formResult = $this->form($userList, $startNum, $args);
-        $this->pagination = $this->c->Func->paginate($pages, $page, 'AdminUsersResult', ['data' => $args['data']]);
+        $this->pagination = $this->c->Func->paginate(
+            $pages,
+            $page,
+            'AdminUsersResult',
+            [
+                'data' => $args['data'],
+            ]
+        );
 
 
         return $this;
         return $this;
     }
     }
@@ -170,6 +177,7 @@ class Result extends Users
         }
         }
 
 
         $ids = \array_flip($ids);
         $ids = \array_flip($ids);
+
         return \array_merge($fromPosts, $ids);
         return \array_merge($fromPosts, $ids);
     }
     }
 
 

+ 8 - 1
app/Models/Pages/Admin/Users/Stat.php

@@ -50,7 +50,14 @@ class Stat extends Users
             $user->username,
             $user->username,
         ];
         ];
         $this->formResult = $this->form($stat, $startNum);
         $this->formResult = $this->form($stat, $startNum);
-        $this->pagination = $this->c->Func->paginate($pages, $page, 'AdminUserStat', ['id' => $args['id']]);
+        $this->pagination = $this->c->Func->paginate(
+            $pages,
+            $page,
+            'AdminUserStat',
+            [
+                'id' => $args['id'],
+            ]
+        );
 
 
         return $this;
         return $this;
     }
     }

+ 2 - 0
app/Models/Pages/Auth.php

@@ -28,6 +28,7 @@ class Auth extends Page
         $this->c->users->updateLastVisit($this->user);
         $this->c->users->updateLastVisit($this->user);
 
 
         $this->c->Lang->load('auth');
         $this->c->Lang->load('auth');
+
         return $this->c->Redirect->page('Index')->message('Logout redirect');
         return $this->c->Redirect->page('Index')->message('Logout redirect');
     }
     }
 
 
@@ -357,6 +358,7 @@ class Auth extends Page
                 $this->c->users->update($user);
                 $this->c->users->update($user);
 
 
                 $this->fIswev = ['s', __('Pass updated')];
                 $this->fIswev = ['s', __('Pass updated')];
+
                 return $this->login([], 'GET');
                 return $this->login([], 'GET');
             }
             }
 
 

+ 4 - 0
app/Models/Pages/Install.php

@@ -53,6 +53,7 @@ class Install extends Page
                 }
                 }
             }
             }
         }
         }
+
         return $dbTypes;
         return $dbTypes;
     }
     }
 
 
@@ -417,6 +418,7 @@ class Install extends Page
                 $v->addError('Prefix reserved');
                 $v->addError('Prefix reserved');
             }
             }
         }
         }
+
         return $prefix;
         return $prefix;
     }
     }
 
 
@@ -468,6 +470,7 @@ class Install extends Page
             $stat = $this->c->DB->statistics();
             $stat = $this->c->DB->statistics();
         } catch (PDOException $e) {
         } catch (PDOException $e) {
             $v->addError($e->getMessage());
             $v->addError($e->getMessage());
+
             return $dbhost;
             return $dbhost;
         }
         }
 
 
@@ -476,6 +479,7 @@ class Install extends Page
             $stmt = $this->c->DB->query('SELECT 1 FROM ::users LIMIT 1');
             $stmt = $this->c->DB->query('SELECT 1 FROM ::users LIMIT 1');
             if (! empty($stmt->fetch())) {
             if (! empty($stmt->fetch())) {
                 $v->addError(__('Existing table error', $v->dbprefix, $v->dbname));
                 $v->addError(__('Existing table error', $v->dbprefix, $v->dbname));
+
                 return $dbhost;
                 return $dbhost;
             }
             }
         } catch (PDOException $e) {
         } catch (PDOException $e) {

+ 14 - 0
app/Models/Pages/Moderate.php

@@ -196,6 +196,7 @@ class Moderate extends Page
         if (! $v->validation($_POST)) {
         if (! $v->validation($_POST)) {
             $message         = $this->c->Message->message('Bad request');
             $message         = $this->c->Message->message('Bad request');
             $message->fIswev = $v->getErrors();
             $message->fIswev = $v->getErrors();
+
             return $message;
             return $message;
         }
         }
 
 
@@ -292,12 +293,14 @@ class Moderate extends Page
                 $this->buttonValue = __('Open');
                 $this->buttonValue = __('Open');
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->form        = $this->formConfirm($topics, $v);
                 $this->form        = $this->formConfirm($topics, $v);
+
                 return $this;
                 return $this;
             case 2:
             case 2:
                 if (1 === $v->confirm) {
                 if (1 === $v->confirm) {
                     $this->c->topics->access(true, ...$topics);
                     $this->c->topics->access(true, ...$topics);
 
 
                     $message = 1 === \count($topics) ? 'Open topic redirect' : 'Open topics redirect';
                     $message = 1 === \count($topics) ? 'Open topic redirect' : 'Open topics redirect';
+
                     return $this->c->Redirect->url($this->backLink)->message($message);
                     return $this->c->Redirect->url($this->backLink)->message($message);
                 } else {
                 } else {
                     return $this->actionCancel($topics, $v);
                     return $this->actionCancel($topics, $v);
@@ -315,12 +318,14 @@ class Moderate extends Page
                 $this->buttonValue = __('Close');
                 $this->buttonValue = __('Close');
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->form        = $this->formConfirm($topics, $v);
                 $this->form        = $this->formConfirm($topics, $v);
+
                 return $this;
                 return $this;
             case 2:
             case 2:
                 if (1 === $v->confirm) {
                 if (1 === $v->confirm) {
                     $this->c->topics->access(false, ...$topics);
                     $this->c->topics->access(false, ...$topics);
 
 
                     $message = 1 === \count($topics) ? 'Close topic redirect' : 'Close topics redirect';
                     $message = 1 === \count($topics) ? 'Close topic redirect' : 'Close topics redirect';
+
                     return $this->c->Redirect->url($this->backLink)->message($message);
                     return $this->c->Redirect->url($this->backLink)->message($message);
                 } else {
                 } else {
                     return $this->actionCancel($topics, $v);
                     return $this->actionCancel($topics, $v);
@@ -355,6 +360,7 @@ class Moderate extends Page
                 $this->buttonValue = __('Delete');
                 $this->buttonValue = __('Delete');
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->form        = $this->formConfirm($objects, $v);
                 $this->form        = $this->formConfirm($objects, $v);
+
                 return $this;
                 return $this;
             case 2:
             case 2:
                 if (1 === $v->confirm) {
                 if (1 === $v->confirm) {
@@ -384,6 +390,7 @@ class Moderate extends Page
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->chkRedirect = true;
                 $this->chkRedirect = true;
                 $this->form        = $this->formConfirm($topics, $v);
                 $this->form        = $this->formConfirm($topics, $v);
+
                 return $this;
                 return $this;
             case 2:
             case 2:
                 if (1 === $v->confirm) {
                 if (1 === $v->confirm) {
@@ -391,6 +398,7 @@ class Moderate extends Page
                     $this->c->topics->move(1 === $v->redirect, $forum, ...$topics);
                     $this->c->topics->move(1 === $v->redirect, $forum, ...$topics);
 
 
                     $message = 1 === \count($topics) ? 'Move topic redirect' : 'Move topics redirect';
                     $message = 1 === \count($topics) ? 'Move topic redirect' : 'Move topics redirect';
+
                     return $this->c->Redirect->url($this->curForum->link)->message($message);
                     return $this->c->Redirect->url($this->curForum->link)->message($message);
                 } else {
                 } else {
                     return $this->actionCancel($topics, $v);
                     return $this->actionCancel($topics, $v);
@@ -421,6 +429,7 @@ class Moderate extends Page
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $this->curForum);
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $this->curForum);
                 $this->chkRedirect = true;
                 $this->chkRedirect = true;
                 $this->form        = $this->formConfirm($topics, $v);
                 $this->form        = $this->formConfirm($topics, $v);
+
                 return $this;
                 return $this;
             case 2:
             case 2:
                 if (1 === $v->confirm) {
                 if (1 === $v->confirm) {
@@ -443,6 +452,7 @@ class Moderate extends Page
                 $this->buttonValue = __('Unstick');
                 $this->buttonValue = __('Unstick');
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->form        = $this->formConfirm($topics, $v);
                 $this->form        = $this->formConfirm($topics, $v);
+
                 return $this;
                 return $this;
             case 2:
             case 2:
                 if (1 === $v->confirm) {
                 if (1 === $v->confirm) {
@@ -452,6 +462,7 @@ class Moderate extends Page
                     }
                     }
 
 
                     $message = 1 === \count($topics) ? 'Unstick topic redirect' : 'Unstick topics redirect';
                     $message = 1 === \count($topics) ? 'Unstick topic redirect' : 'Unstick topics redirect';
+
                     return $this->c->Redirect->url($this->backLink)->message($message);
                     return $this->c->Redirect->url($this->backLink)->message($message);
                 } else {
                 } else {
                     return $this->actionCancel($topics, $v);
                     return $this->actionCancel($topics, $v);
@@ -469,6 +480,7 @@ class Moderate extends Page
                 $this->buttonValue = __('Stick');
                 $this->buttonValue = __('Stick');
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->form        = $this->formConfirm($topics, $v);
                 $this->form        = $this->formConfirm($topics, $v);
+
                 return $this;
                 return $this;
             case 2:
             case 2:
                 if (1 === $v->confirm) {
                 if (1 === $v->confirm) {
@@ -478,6 +490,7 @@ class Moderate extends Page
                     }
                     }
 
 
                     $message = 1 === \count($topics) ? 'Stick topic redirect' : 'Stick topics redirect';
                     $message = 1 === \count($topics) ? 'Stick topic redirect' : 'Stick topics redirect';
+
                     return $this->c->Redirect->url($this->backLink)->message($message);
                     return $this->c->Redirect->url($this->backLink)->message($message);
                 } else {
                 } else {
                     return $this->actionCancel($topics, $v);
                     return $this->actionCancel($topics, $v);
@@ -496,6 +509,7 @@ class Moderate extends Page
                 $this->needSubject = true;
                 $this->needSubject = true;
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $this->curTopic);
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $this->curTopic);
                 $this->form        = $this->formConfirm($posts, $v);
                 $this->form        = $this->formConfirm($posts, $v);
+
                 return $this;
                 return $this;
             case 2:
             case 2:
                 if (1 === $v->confirm) {
                 if (1 === $v->confirm) {

+ 1 - 0
app/Models/Pages/PostValidatorTrait.php

@@ -30,6 +30,7 @@ trait PostValidatorTrait
         ) {
         ) {
             $v->addError('All caps subject');
             $v->addError('All caps subject');
         }
         }
+
         return $subject;
         return $subject;
     }
     }
 
 

+ 1 - 0
app/Models/Pages/Profile.php

@@ -174,6 +174,7 @@ abstract class Profile extends Page
                 __('Configure '),
                 __('Configure '),
             ];
             ];
         }
         }
+
         return $btns;
         return $btns;
     }
     }
 
 

+ 1 - 1
app/Models/Pages/Profile/Config.php

@@ -128,7 +128,7 @@ class Config extends Profile
                 'token' => $this->c->Csrf->create(
                 'token' => $this->c->Csrf->create(
                     'EditUserBoardConfig',
                     'EditUserBoardConfig',
                     [
                     [
-                        'id' => $this->curUser->id
+                        'id' => $this->curUser->id,
                     ]
                     ]
                 ),
                 ),
             ],
             ],

+ 3 - 0
app/Models/Pages/Redirect.php

@@ -31,6 +31,7 @@ class Redirect extends Page
             $marker,
             $marker,
             $args
             $args
         );
         );
+
         return $this;
         return $this;
     }
     }
 
 
@@ -44,6 +45,7 @@ class Redirect extends Page
     public function url(string $url): Page
     public function url(string $url): Page
     {
     {
         $this->link = $url;
         $this->link = $url;
+
         return $this;
         return $this;
     }
     }
 
 
@@ -81,6 +83,7 @@ class Redirect extends Page
         if (null === $this->nameTpl) {
         if (null === $this->nameTpl) {
             $this->header('Location', $this->link);
             $this->header('Location', $this->link);
         }
         }
+
         return parent::getHttpHeaders();
         return parent::getHttpHeaders();
     }
     }
 
 

+ 3 - 0
app/Models/Pages/Register.php

@@ -236,12 +236,14 @@ class Register extends Page
             } else {
             } else {
                 $auth         = $this->c->Auth;
                 $auth         = $this->c->Auth;
                 $auth->fIswev = ['w', __('Error welcom mail', $this->c->config->o_admin_email)];
                 $auth->fIswev = ['w', __('Error welcom mail', $this->c->config->o_admin_email)];
+
                 return $auth->forget(['_email' => $v->email], 'GET');
                 return $auth->forget(['_email' => $v->email], 'GET');
             }
             }
         // форма логина
         // форма логина
         } else {
         } else {
             $auth         = $this->c->Auth;
             $auth         = $this->c->Auth;
             $auth->fIswev = ['s', __('Reg complete')];
             $auth->fIswev = ['s', __('Reg complete')];
+
             return $auth->login(['_username' => $v->username], 'GET');
             return $auth->login(['_username' => $v->username], 'GET');
         }
         }
     }
     }
@@ -275,6 +277,7 @@ class Register extends Page
 
 
         $auth         = $this->c->Auth;
         $auth         = $this->c->Auth;
         $auth->fIswev = ['s', __('Reg complete')];
         $auth->fIswev = ['s', __('Reg complete')];
+
         return $auth->login(['_username' => $user->username], 'GET');
         return $auth->login(['_username' => $user->username], 'GET');
     }
     }
 }
 }

+ 13 - 2
app/Models/Pages/Rules.php

@@ -19,7 +19,12 @@ class Rules extends Page
         $this->onlinePos  = 'rules';
         $this->onlinePos  = 'rules';
         $this->canonical  = $this->c->Router->link('Rules');
         $this->canonical  = $this->c->Router->link('Rules');
         $this->title      = __('Forum rules');
         $this->title      = __('Forum rules');
-        $this->crumbs     = $this->crumbs([$this->c->Router->link('Rules'), __('Forum rules')]);
+        $this->crumbs     = $this->crumbs(
+            [
+                $this->c->Router->link('Rules'),
+                __('Forum rules'),
+            ]
+        );
         $this->rules      = $this->c->config->o_rules_message;
         $this->rules      = $this->c->config->o_rules_message;
 
 
         return $this;
         return $this;
@@ -39,7 +44,13 @@ class Rules extends Page
         $this->onlinePos  = 'rules';
         $this->onlinePos  = 'rules';
         $this->robots     = 'noindex';
         $this->robots     = 'noindex';
         $this->title      = __('Forum rules');
         $this->title      = __('Forum rules');
-        $this->crumbs     = $this->crumbs(__('Forum rules'), [$this->c->Router->link('Register'), __('Register')]);
+        $this->crumbs     = $this->crumbs(
+            __('Forum rules'),
+            [
+                $this->c->Router->link('Register'),
+                __('Register'),
+            ]
+        );
         $this->rules      = '1' == $this->c->config->o_rules ? $this->c->config->o_rules_message : __('If no rules');
         $this->rules      = '1' == $this->c->config->o_rules ? $this->c->config->o_rules_message : __('If no rules');
         $this->form       = $this->formAgree();
         $this->form       = $this->formAgree();
 
 

+ 2 - 0
app/Models/Pages/Search.php

@@ -533,6 +533,7 @@ class Search extends Page
             return $this->c->Message->message('Bad request');
             return $this->c->Message->message('Bad request');
         } elseif (empty($list)) {
         } elseif (empty($list)) {
             $this->fIswev = ['i', __('No hits')];
             $this->fIswev = ['i', __('No hits')];
+
             return $this->view([], 'GET', true);
             return $this->view([], 'GET', true);
         }
         }
 
 
@@ -569,6 +570,7 @@ class Search extends Page
     protected function crumbs(...$crumbs): array
     protected function crumbs(...$crumbs): array
     {
     {
         $crumbs[] = [$this->c->Router->link('Search'), __('Search')];
         $crumbs[] = [$this->c->Router->link('Search'), __('Search')];
+
         return parent::crumbs(...$crumbs);
         return parent::crumbs(...$crumbs);
     }
     }
 }
 }

+ 6 - 1
app/Models/Pages/Userlist.php

@@ -146,7 +146,12 @@ class Userlist extends Page
             $args
             $args
         );
         );
         $this->robots       = 'noindex';
         $this->robots       = 'noindex';
-        $this->crumbs       = $this->crumbs([$this->c->Router->link('Userlist'), __('User list')]);
+        $this->crumbs       = $this->crumbs(
+            [
+                $this->c->Router->link('Userlist'),
+                __('User list'),
+            ]
+        );
         $this->pagination   = $this->c->Func->paginate($pages, $page, 'Userlist', $args);
         $this->pagination   = $this->c->Func->paginate($pages, $page, 'Userlist', $args);
         $this->form         = $this->formUserlist($v);
         $this->form         = $this->formUserlist($v);
 
 

+ 1 - 0
app/Models/Post/Manager.php

@@ -103,6 +103,7 @@ class Manager extends ManagerModel
     {
     {
         $id = $this->Save->insert($post);
         $id = $this->Save->insert($post);
         $this->set($id, $post);
         $this->set($id, $post);
+
         return $id;
         return $id;
     }
     }
 }
 }

+ 3 - 0
app/Models/Report/Manager.php

@@ -35,6 +35,7 @@ class Manager extends ManagerModel
         } else {
         } else {
             $report = $this->Load->load($id);
             $report = $this->Load->load($id);
             $this->set($id, $report);
             $this->set($id, $report);
+
             return $report;
             return $report;
         }
         }
     }
     }
@@ -57,6 +58,7 @@ class Manager extends ManagerModel
                 $this->set($report->id, $report);
                 $this->set($report->id, $report);
             }
             }
         }
         }
+
         return $result;
         return $result;
     }
     }
 
 
@@ -83,6 +85,7 @@ class Manager extends ManagerModel
     {
     {
         $id = $this->Save->insert($report);
         $id = $this->Save->insert($report);
         $this->set($id, $report);
         $this->set($id, $report);
+
         return $id;
         return $id;
     }
     }
 
 

+ 1 - 0
app/Models/Search/Execute.php

@@ -72,6 +72,7 @@ class Execute extends Method
             $result                    = \explode("\n", $row['search_data']);
             $result                    = \explode("\n", $row['search_data']);
             $this->model->queryIds     = '' == $result[0] ? [] : \array_map('\\intval', \explode(',', $result[0]));
             $this->model->queryIds     = '' == $result[0] ? [] : \array_map('\\intval', \explode(',', $result[0]));
             $this->model->queryNoCache = false;
             $this->model->queryNoCache = false;
+
             return true;
             return true;
         } elseif ($flood) {
         } elseif ($flood) {
             return false;
             return false;

+ 1 - 0
app/Models/Search/Index.php

@@ -147,6 +147,7 @@ class Index extends Method
                 $words[] = $word;
                 $words[] = $word;
             }
             }
         }
         }
+
         return $words;
         return $words;
     }
     }
 }
 }

+ 2 - 0
app/Models/Search/Prepare.php

@@ -19,6 +19,7 @@ class Prepare extends Method
             $this->model->queryError = 'Odd number of quotes: \'%s\'';
             $this->model->queryError = 'Odd number of quotes: \'%s\'';
             $this->model->queryWords = [];
             $this->model->queryWords = [];
             $this->model->queryText  = $query;
             $this->model->queryText  = $query;
+
             return false;
             return false;
         }
         }
 
 
@@ -194,6 +195,7 @@ class Prepare extends Method
             $result .= $space . $word;
             $result .= $space . $word;
             $space   = ' ';
             $space   = ' ';
         }
         }
+
         return $result;
         return $result;
     }
     }
 }
 }

+ 1 - 0
app/Models/SmileyList/Load.php

@@ -19,6 +19,7 @@ class Load extends Method
         $list = $this->c->DB->query('SELECT sm.text, sm.image FROM ::smilies AS sm ORDER BY sm.disp_position')->fetchAll(PDO::FETCH_KEY_PAIR); //???? text уникальное?
         $list = $this->c->DB->query('SELECT sm.text, sm.image FROM ::smilies AS sm ORDER BY sm.disp_position')->fetchAll(PDO::FETCH_KEY_PAIR); //???? text уникальное?
         $this->model->list = $list;
         $this->model->list = $list;
         $this->c->Cache->set('smilies', $list);
         $this->c->Cache->set('smilies', $list);
+
         return $this->model;
         return $this->model;
     }
     }
 }
 }

+ 1 - 0
app/Models/SmileyList/Model.php

@@ -18,6 +18,7 @@ class Model extends ParentModel
         } else {
         } else {
             $this->load();
             $this->load();
         }
         }
+
         return $this;
         return $this;
     }
     }
 }
 }

+ 1 - 0
app/Models/Stats/Model.php

@@ -36,6 +36,7 @@ class Model extends ParentModel
     public function reset(): self
     public function reset(): self
     {
     {
         $this->c->Cache->delete('stats');
         $this->c->Cache->delete('stats');
+
         return $this;
         return $this;
     }
     }
 }
 }

+ 3 - 0
app/Models/Stopwords/Model.php

@@ -22,6 +22,7 @@ class Model extends ParentModel
         } else {
         } else {
             $this->load();
             $this->load();
         }
         }
+
         return $this;
         return $this;
     }
     }
 
 
@@ -63,6 +64,7 @@ class Model extends ParentModel
 
 
         if (! \is_array($this->files)) {
         if (! \is_array($this->files)) {
             $this->list = [];
             $this->list = [];
+
             return $this;
             return $this;
         }
         }
 
 
@@ -78,6 +80,7 @@ class Model extends ParentModel
 
 
         $this->c->Cache->set('stopwords', ['id' => $id, 'stopwords' => $stopwords]);
         $this->c->Cache->set('stopwords', ['id' => $id, 'stopwords' => $stopwords]);
         $this->list = $stopwords;
         $this->list = $stopwords;
+
         return $this;
         return $this;
     }
     }
 }
 }

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

@@ -68,6 +68,7 @@ class Load extends Action
 
 
         if ($forum instanceof Forum) {
         if ($forum instanceof Forum) {
             $forum->__mf_mark_all_read = $topic->mf_mark_all_read;
             $forum->__mf_mark_all_read = $topic->mf_mark_all_read;
+
             return $topic;
             return $topic;
         } else {
         } else {
             return null;
             return null;
@@ -112,6 +113,7 @@ class Load extends Action
                 }
                 }
             }
             }
         }
         }
+
         return $result;
         return $result;
     }
     }
 }
 }

+ 2 - 0
app/Models/Topic/Manager.php

@@ -33,6 +33,7 @@ class Manager extends ManagerModel
         } else {
         } else {
             $topic = $this->Load->load($id);
             $topic = $this->Load->load($id);
             $this->set($id, $topic);
             $this->set($id, $topic);
+
             return $topic;
             return $topic;
         }
         }
     }
     }
@@ -92,6 +93,7 @@ class Manager extends ManagerModel
     {
     {
         $id = $this->Save->insert($topic);
         $id = $this->Save->insert($topic);
         $this->set($id, $topic);
         $this->set($id, $topic);
+
         return $id;
         return $id;
     }
     }
 }
 }

+ 9 - 1
app/Models/Topic/Model.php

@@ -267,7 +267,15 @@ class Model extends DataModel
             // 1 страницу в списке тем раздела не отображаем
             // 1 страницу в списке тем раздела не отображаем
             return [];
             return [];
         } else { //????
         } else { //????
-            return $this->c->Func->paginate($this->numPages, $page, 'Topic', ['id' => $this->id, 'name' => \ForkBB\cens($this->subject)]);
+            return $this->c->Func->paginate(
+                $this->numPages,
+                $page,
+                'Topic',
+                [
+                    'id'   => $this->id,
+                    'name' => \ForkBB\cens($this->subject),
+                ]
+            );
         }
         }
     }
     }
 
 

+ 4 - 0
app/Models/User/Current.php

@@ -80,6 +80,7 @@ class Current extends Action
         $user              = $this->manager->create($data);
         $user              = $this->manager->create($data);
         $user->__ip        = $ip;
         $user->__ip        = $ip;
         $user->__userAgent = $this->getUserAgent();
         $user->__userAgent = $this->getUserAgent();
+
         return $user;
         return $user;
     }
     }
 
 
@@ -144,6 +145,7 @@ class Current extends Action
         ) {
         ) {
             return false;
             return false;
         }
         }
+
         return $this->nameBot($agent, $agentL);
         return $this->nameBot($agent, $agentL);
     }
     }
 
 
@@ -240,6 +242,7 @@ class Current extends Action
         } elseif (\strlen($agent) > 25) {
         } elseif (\strlen($agent) > 25) {
             $agent = 'Unknown';
             $agent = 'Unknown';
         }
         }
+
         return $agent;
         return $agent;
     }
     }
 
 
@@ -272,6 +275,7 @@ class Current extends Action
                 }
                 }
             }
             }
         }
         }
+
         return $this->c->config->o_default_lang;
         return $this->c->config->o_default_lang;
     }
     }
 }
 }

+ 1 - 3
app/Models/User/Filter.php

@@ -103,8 +103,6 @@ class Filter extends Action
             WHERE {$where}
             WHERE {$where}
             ORDER BY {$orderBy}";
             ORDER BY {$orderBy}";
 
 
-        $ids = $this->c->DB->query($query, $vars)->fetchAll(PDO::FETCH_COLUMN);
-
-        return $ids;
+        return $this->c->DB->query($query, $vars)->fetchAll(PDO::FETCH_COLUMN);
     }
     }
 }
 }

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

@@ -22,6 +22,7 @@ class IsUniqueName extends Action
             ':other' => \preg_replace('%[^\p{L}\p{N}]%u', '', $user->username), //???? что за бред :)
             ':other' => \preg_replace('%[^\p{L}\p{N}]%u', '', $user->username), //???? что за бред :)
         ];
         ];
         $result = $this->c->DB->query('SELECT u.username FROM ::users AS u WHERE (LOWER(u.username)=LOWER(?s:name) OR LOWER(u.username)=LOWER(?s:other)) AND u.id!=?i:id', $vars)->fetchAll();
         $result = $this->c->DB->query('SELECT u.username FROM ::users AS u WHERE (LOWER(u.username)=LOWER(?s:name) OR LOWER(u.username)=LOWER(?s:other)) AND u.id!=?i:id', $vars)->fetchAll();
+
         return ! \count($result);
         return ! \count($result);
     }
     }
 }
 }

+ 1 - 0
app/Models/User/Load.php

@@ -66,6 +66,7 @@ class Load extends Action
         foreach ($data as $row) {
         foreach ($data as $row) {
             $result[] = $this->manager->create($row);
             $result[] = $this->manager->create($row);
         }
         }
+
         return $result;
         return $result;
     }
     }
 
 

+ 2 - 0
app/Models/User/Manager.php

@@ -29,6 +29,7 @@ class Manager extends ManagerModel
         } else {
         } else {
             $user = $this->Load->load($id);
             $user = $this->Load->load($id);
             $this->set($id, $user);
             $this->set($id, $user);
+
             return $user;
             return $user;
         }
         }
     }
     }
@@ -123,6 +124,7 @@ class Manager extends ManagerModel
     {
     {
         $id = $this->Save->insert($user);
         $id = $this->Save->insert($user);
         $this->set($id, $user);
         $this->set($id, $user);
+
         return $id;
         return $id;
     }
     }
 }
 }

+ 1 - 0
app/Models/User/Model.php

@@ -100,6 +100,7 @@ class Model extends DataModel
                 throw new RuntimeException('Moderator\'s rights can not be found');
                 throw new RuntimeException('Moderator\'s rights can not be found');
             }
             }
         }
         }
+
         return isset($model->moderators[$this->id]);
         return isset($model->moderators[$this->id]);
     }
     }
 
 

+ 2 - 0
app/Models/Validators/Email.php

@@ -29,10 +29,12 @@ class Email extends Validators
         // проверка длины email
         // проверка длины email
         } elseif (\mb_strlen($email, 'UTF-8') > $this->c->MAX_EMAIL_LENGTH) {
         } elseif (\mb_strlen($email, 'UTF-8') > $this->c->MAX_EMAIL_LENGTH) {
             $v->addError('Long email');
             $v->addError('Long email');
+
             return $email;
             return $email;
         // это не email
         // это не email
         } elseif (false === ($result = $this->c->Mail->valid($email, true))) {
         } elseif (false === ($result = $this->c->Mail->valid($email, true))) {
             $v->addError('The :alias is not valid email');
             $v->addError('The :alias is not valid email');
+
             return $email;
             return $email;
         // есть другие ошибки
         // есть другие ошибки
         } elseif (! empty($v->getErrors())) {
         } elseif (! empty($v->getErrors())) {

+ 1 - 0
app/Models/Validators/NoURL.php

@@ -27,6 +27,7 @@ class NoURL extends Validators
         ) {
         ) {
             $v->addError('The :alias contains a link');
             $v->addError('The :alias contains a link');
         }
         }
+
         return $value;
         return $value;
     }
     }
 }
 }

+ 2 - 2
app/config/defaultBBCode.php

@@ -236,10 +236,10 @@ return [
              $arr[] = $hours . __('After time H');
              $arr[] = $hours . __('After time H');
          }
          }
          if ($min > 0) {
          if ($min > 0) {
-             $arr[] = (($min < 10) ? '0' . $min : $min) . __('After time i');
+             $arr[] = ($min < 10 ? '0' . $min : $min) . __('After time i');
          }
          }
          if ($sec > 0) {
          if ($sec > 0) {
-             $arr[] = (($sec < 10) ? '0' . $sec : $sec) . __('After time s');
+             $arr[] = ($sec < 10 ? '0' . $sec : $sec) . __('After time s');
          }
          }
 
 
          $attr = __('After time') . ' ' . implode(' ', $arr);
          $attr = __('After time') . ' ' . implode(' ', $arr);