@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function copyFile(iUser $user) |
48 | 48 | { |
49 | 49 | // move file to original folder |
50 | - $upload = $this->file->move(root . '/upload/user/avatar/original/', $user->id . '.' . $this->file->guessExtension()); |
|
50 | + $upload = $this->file->move(root.'/upload/user/avatar/original/', $user->id.'.'.$this->file->guessExtension()); |
|
51 | 51 | |
52 | 52 | try { |
53 | 53 | // big image |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | $image = new Image(); |
85 | - $image->setCacheDir(root . '/Private/Cache/images'); |
|
85 | + $image->setCacheDir(root.'/Private/Cache/images'); |
|
86 | 86 | |
87 | 87 | $image->open($original->getPathname()) |
88 | 88 | ->cropResize($sizeConvert[$size][0], $sizeConvert[$size][1]) |
89 | - ->save(root . '/upload/user/avatar/' . $size . '/' . $user_id . '.jpg', 'jpg', static::COMPRESS_QUALITY); |
|
89 | + ->save(root.'/upload/user/avatar/'.$size.'/'.$user_id.'.jpg', 'jpg', static::COMPRESS_QUALITY); |
|
90 | 90 | |
91 | 91 | return null; |
92 | 92 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $this->beginTime = time(); |
34 | 34 | |
35 | 35 | $this->signatures = new \DOMDocument(); |
36 | - $this->signatures->load(root . '/Private/Antivirus/Signatures.xml'); |
|
36 | + $this->signatures->load(root.'/Private/Antivirus/Signatures.xml'); |
|
37 | 37 | |
38 | 38 | // list of files is not prepared, 1st iteration |
39 | 39 | if (!File::exist('/Private/Antivirus/ScanFiles.json')) { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | $this->scanFiles = json_decode(File::read('/Private/Antivirus/ScanFiles.json')); |
48 | 48 | if (File::exist('/Private/Antivirus/Infected.json')) { |
49 | - $this->infected = (array)json_decode(File::read('/Private/Antivirus/Infected.json')); |
|
49 | + $this->infected = (array) json_decode(File::read('/Private/Antivirus/Infected.json')); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | |
109 | 109 | switch ($attrFormat) { |
110 | 110 | case 're': |
111 | - if ((preg_match('#(' . $sigContent . ')#smi', $content, $found, PREG_OFFSET_CAPTURE)) || |
|
112 | - (preg_match('#(' . $sigContent . ')#smi', $normalized, $found, PREG_OFFSET_CAPTURE)) |
|
111 | + if ((preg_match('#('.$sigContent.')#smi', $content, $found, PREG_OFFSET_CAPTURE)) || |
|
112 | + (preg_match('#('.$sigContent.')#smi', $normalized, $found, PREG_OFFSET_CAPTURE)) |
|
113 | 113 | ) { |
114 | 114 | $detected = true; |
115 | 115 | $pos = $found[0][1]; |
116 | 116 | $this->infected[$path][] = [ |
117 | - 'pos' => (int)$pos, |
|
117 | + 'pos' => (int) $pos, |
|
118 | 118 | 'sigId' => $attrId, |
119 | 119 | 'sigRule' => $sigContent, |
120 | 120 | 'sever' => $attrSever, |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | (($pos = strpos($normalized, $sigContent)) !== false) |
129 | 129 | ) { |
130 | 130 | $this->infected[$path][] = [ |
131 | - 'pos' => (int)$pos, |
|
131 | + 'pos' => (int) $pos, |
|
132 | 132 | 'sigId' => $attrId, |
133 | 133 | 'sigRule' => $sigContent, |
134 | 134 | 'sever' => $attrSever, |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | private function prepareScanlist() |
150 | 150 | { |
151 | - $files = (object)File::listFiles(root, $this->affectedExt); |
|
151 | + $files = (object) File::listFiles(root, $this->affectedExt); |
|
152 | 152 | File::write('/Private/Antivirus/ScanFiles.json', json_encode($files)); |
153 | 153 | } |
154 | 154 |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | // build path and check is file exists on disk |
98 | - $path = '/upload/gallery/' . $this->id . '/orig/' . $pName; |
|
98 | + $path = '/upload/gallery/'.$this->id.'/orig/'.$pName; |
|
99 | 99 | if (!File::exist($path)) { |
100 | 100 | return null; |
101 | 101 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | // remove extension, thumbs always in jpeg ;D |
118 | 118 | $pName = Str::cleanExtension($pName); |
119 | - $path = '/upload/gallery/' . $this->id . '/thumb/' . $pName . '.jpg'; |
|
119 | + $path = '/upload/gallery/'.$this->id.'/thumb/'.$pName.'.jpg'; |
|
120 | 120 | |
121 | 121 | if (!File::exist($path)) { |
122 | 122 | return null; |
@@ -10,7 +10,7 @@ |
||
10 | 10 | define('env_no_uri', false); |
11 | 11 | define('env_type', 'html'); |
12 | 12 | |
13 | -require_once(root . '/Loader/Autoload.php'); |
|
13 | +require_once(root.'/Loader/Autoload.php'); |
|
14 | 14 | |
15 | 15 | // make fast-access alias \App::$Object |
16 | 16 | // class_alias('Ffcms\Core\App', 'App'); |
@@ -10,7 +10,7 @@ |
||
10 | 10 | define('env_no_uri', true); |
11 | 11 | define('env_type', 'html'); |
12 | 12 | |
13 | -require_once(root . '/Loader/Autoload.php'); |
|
13 | +require_once(root.'/Loader/Autoload.php'); |
|
14 | 14 | |
15 | 15 | // make fast-access alias \App::$Object |
16 | 16 | // class_alias('Ffcms\Core\App', 'App'); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | // this environment is based on json response type |
13 | 13 | define('env_type', 'json'); |
14 | 14 | |
15 | -require_once(root . '/Loader/Autoload.php'); |
|
15 | +require_once(root.'/Loader/Autoload.php'); |
|
16 | 16 | |
17 | 17 | // make fast-access alias \App::$Object |
18 | 18 | // class_alias('Ffcms\Core\App', 'App'); |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function get() |
27 | 27 | { |
28 | - return App::$Alias->scriptUrl . '/api/captcha/gregwar?time=' . microtime(true) . '&lang=' . App::$Request->getLanguage(); |
|
28 | + return App::$Alias->scriptUrl.'/api/captcha/gregwar?time='.microtime(true).'&lang='.App::$Request->getLanguage(); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -5,5 +5,5 @@ |
||
5 | 5 | ?> |
6 | 6 | |
7 | 7 | <?php foreach ($records as $row) { |
8 | - echo Url::link(['content/tag', $row['tag']], $row['tag'], ['class' => 'label label-default']) . ' '; |
|
8 | + echo Url::link(['content/tag', $row['tag']], $row['tag'], ['class' => 'label label-default']).' '; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | public function check() |
58 | 58 | { |
59 | 59 | // check if user is auth'd or guest name is defined |
60 | - if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
60 | + if (!App::$User->isAuth() && ((int) $this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
61 | 61 | throw new JsonException(__('Guest name is not defined')); |
62 | 62 | } |
63 | 63 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | // check if message length is correct |
70 | - if (Str::length($this->message) < (int)$this->_configs['minLength'] || Str::length($this->message) > (int)$this->_configs['maxLength']) { |
|
70 | + if (Str::length($this->message) < (int) $this->_configs['minLength'] || Str::length($this->message) > (int) $this->_configs['maxLength']) { |
|
71 | 71 | throw new JsonException(__('Message length is incorrect. Current: %cur%, min - %min%, max - %max%', [ |
72 | 72 | 'cur' => Str::length($this->message), |
73 | 73 | 'min' => $this->_configs['minLength'], |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | // guest moderation |
79 | - if (!App::$User->isAuth() && (bool)$this->_configs['guestModerate']) { |
|
79 | + if (!App::$User->isAuth() && (bool) $this->_configs['guestModerate']) { |
|
80 | 80 | $captcha = App::$Request->request->get('captcha'); |
81 | 81 | if (!App::$Captcha->validate($captcha)) { |
82 | 82 | throw new JsonException(__('Captcha is incorrect! Click on image to refresh and try again')); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $record->message = $this->message; |
115 | 115 | $record->lang = App::$Request->getLanguage(); |
116 | 116 | // check if premoderation is enabled and user is guest |
117 | - if ((int)$this->_configs['guestModerate'] === 1 && $this->_userId < 1) { |
|
117 | + if ((int) $this->_configs['guestModerate'] === 1 && $this->_userId < 1) { |
|
118 | 118 | $record->moderate = 1; |
119 | 119 | } |
120 | 120 | $record->save(); |