@@ -30,11 +30,11 @@ |
||
| 30 | 30 | </div> |
| 31 | 31 | <br /> |
| 32 | 32 | <div class="so-datatables"> |
| 33 | - <?php if (! empty($last_cached_time)) : ?> |
|
| 33 | + <?php if (!empty($last_cached_time)) : ?> |
|
| 34 | 34 | <?php _e('panel', 'log_label_cache_time', 'Report generated time'); ?>: <strong class="text-info"><?php echo $last_cached_time; ?></strong> |
| 35 | 35 | |
| 36 | 36 | <?php endif; ?> |
| 37 | - <?php if (! empty($ipStatus)) : ?> |
|
| 37 | + <?php if (!empty($ipStatus)) : ?> |
|
| 38 | 38 | <pre><?php echo nl2br($ipStatus); ?></pre> |
| 39 | 39 | <?php endif; ?> |
| 40 | 40 | </div> |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | var captchaCount = <?php echo ($period_data['captcha_count'] ?? 0); ?>; |
| 18 | 18 | |
| 19 | 19 | // Today |
| 20 | - <?php if (! empty($past_seven_hours)) : ?> |
|
| 20 | + <?php if (!empty($past_seven_hours)) : ?> |
|
| 21 | 21 | var pageviewChartString = [<?php echo ($past_seven_hours['pageview_chart_string'] ?? ''); ?>]; |
| 22 | 22 | var captchaChartString = [<?php echo ($past_seven_hours['captcha_chart_string'] ?? ''); ?>]; |
| 23 | 23 | var labelChartString = [<?php echo ($past_seven_hours['label_chart_string'] ?? ''); ?>]; |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | <div class="card-body"> |
| 116 | 116 | <form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post" autocomplete="off"> |
| 117 | 117 | <div class="main-content"> |
| 118 | - <?php if (! empty($error)) : ?> |
|
| 118 | + <?php if (!empty($error)) : ?> |
|
| 119 | 119 | <div class="error-notice"> |
| 120 | 120 | <?php echo $error; ?> |
| 121 | 121 | </div> |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | <div class="input-box"> |
| 127 | 127 | <input type="password" name="s_pass" placeholder="Password" class="form-input" /> |
| 128 | 128 | </div> |
| 129 | - <?php if (! empty($this->captcha)) : ?> |
|
| 129 | + <?php if (!empty($this->captcha)) : ?> |
|
| 130 | 130 | <div class="input-box"> |
| 131 | 131 | <?php foreach ($this->captcha as $captcha) : ?> |
| 132 | 132 | <?php echo $captcha->form(); ?> |
@@ -201,13 +201,12 @@ discard block |
||
| 201 | 201 | $imgHeight = $this->properties['img_height']; |
| 202 | 202 | |
| 203 | 203 | // Determine angle and position. |
| 204 | - $length = strlen($this->word); |
|
| 204 | + $length = strlen($this->word); |
|
| 205 | 205 | $angle = ($length >= 6) ?mt_rand(-($length - 6), ($length - 6)) : 0; |
| 206 | 206 | $xAxis = mt_rand(6, (360 / $length) - 16); |
| 207 | 207 | |
| 208 | 208 | $yAxis = ($angle >= 0) ? |
| 209 | - mt_rand($imgHeight, $imgWidth) : |
|
| 210 | - mt_rand(6, $imgHeight); |
|
| 209 | + mt_rand($imgHeight, $imgWidth) : mt_rand(6, $imgHeight); |
|
| 211 | 210 | |
| 212 | 211 | // Create image. |
| 213 | 212 | if (function_exists('imagecreatetruecolor')) { |
@@ -258,7 +257,7 @@ discard block |
||
| 258 | 257 | $y = 0; |
| 259 | 258 | |
| 260 | 259 | for ($i = 0; $i < $length; $i++) { |
| 261 | - $y = mt_rand(0 , $imgHeight / 2); |
|
| 260 | + $y = mt_rand(0, $imgHeight / 2); |
|
| 262 | 261 | imagestring($im, 5, $x, $y, $this->word[$i], $colors['text']); |
| 263 | 262 | $x += ($this->properties['font_spacing'] * 2); |
| 264 | 263 | } |
@@ -267,7 +266,7 @@ discard block |
||
| 267 | 266 | imagerectangle($im, 0, 0, $imgWidth - 1, $imgHeight - 1, $colors['border']); |
| 268 | 267 | |
| 269 | 268 | // Generate image in base64 string. |
| 270 | - ob_start (); |
|
| 269 | + ob_start(); |
|
| 271 | 270 | |
| 272 | 271 | if (function_exists('imagejpeg')) { |
| 273 | 272 | $this->imageType = 'jpeg'; |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | public function isDenied(): bool |
| 46 | 46 | { |
| 47 | 47 | if (!empty($this->deniedList)) { |
| 48 | - if (preg_match('/(' . implode('|', $this->deniedList). ')/i', $this->rdns)) { |
|
| 48 | + if (preg_match('/(' . implode('|', $this->deniedList) . ')/i', $this->rdns)) { |
|
| 49 | 49 | return true; |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -49,19 +49,19 @@ discard block |
||
| 49 | 49 | $this->deniedList = [ |
| 50 | 50 | |
| 51 | 51 | // Backlink crawlers |
| 52 | - 'Ahrefs', // http://ahrefs.com/robot/ |
|
| 53 | - 'roger', // rogerbot (SEOMOZ) |
|
| 54 | - 'moz.com', // SEOMOZ crawlers |
|
| 55 | - 'MJ12bot', // Majestic crawlers |
|
| 56 | - 'findlinks', // http://wortschatz.uni-leipzig.de/findlinks |
|
| 57 | - 'Semrush', // http://www.semrush.com/bot.html |
|
| 52 | + 'Ahrefs', // http://ahrefs.com/robot/ |
|
| 53 | + 'roger', // rogerbot (SEOMOZ) |
|
| 54 | + 'moz.com', // SEOMOZ crawlers |
|
| 55 | + 'MJ12bot', // Majestic crawlers |
|
| 56 | + 'findlinks', // http://wortschatz.uni-leipzig.de/findlinks |
|
| 57 | + 'Semrush', // http://www.semrush.com/bot.html |
|
| 58 | 58 | |
| 59 | 59 | // Web information crawlers |
| 60 | - 'domain', // Domain name information crawlers. |
|
| 61 | - 'copyright', // Copyright information crawlers. |
|
| 60 | + 'domain', // Domain name information crawlers. |
|
| 61 | + 'copyright', // Copyright information crawlers. |
|
| 62 | 62 | |
| 63 | 63 | // Others |
| 64 | - 'archive', // Wayback machine |
|
| 64 | + 'archive', // Wayback machine |
|
| 65 | 65 | ]; |
| 66 | 66 | } |
| 67 | 67 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | public function isDenied(): bool |
| 72 | 72 | { |
| 73 | 73 | if (!empty($this->deniedList)) { |
| 74 | - if (preg_match('/(' . implode('|', $this->deniedList). ')/i', $this->userAgent)) { |
|
| 74 | + if (preg_match('/(' . implode('|', $this->deniedList) . ')/i', $this->userAgent)) { |
|
| 75 | 75 | return true; |
| 76 | 76 | } |
| 77 | 77 | } |
@@ -40,19 +40,19 @@ discard block |
||
| 40 | 40 | protected $deniedList = [ |
| 41 | 41 | |
| 42 | 42 | // Backlink crawlers |
| 43 | - 'Ahrefs', // http://ahrefs.com/robot/ |
|
| 44 | - 'roger', // rogerbot (SEOMOZ) |
|
| 45 | - 'moz.com', // SEOMOZ crawlers |
|
| 46 | - 'MJ12bot', // Majestic crawlers |
|
| 47 | - 'findlinks', // http://wortschatz.uni-leipzig.de/findlinks |
|
| 48 | - 'Semrush', // http://www.semrush.com/bot.html |
|
| 43 | + 'Ahrefs', // http://ahrefs.com/robot/ |
|
| 44 | + 'roger', // rogerbot (SEOMOZ) |
|
| 45 | + 'moz.com', // SEOMOZ crawlers |
|
| 46 | + 'MJ12bot', // Majestic crawlers |
|
| 47 | + 'findlinks', // http://wortschatz.uni-leipzig.de/findlinks |
|
| 48 | + 'Semrush', // http://www.semrush.com/bot.html |
|
| 49 | 49 | |
| 50 | 50 | // Web information crawlers |
| 51 | - 'domain', // Domain name information crawlers. |
|
| 52 | - 'copyright', // Copyright information crawlers. |
|
| 51 | + 'domain', // Domain name information crawlers. |
|
| 52 | + 'copyright', // Copyright information crawlers. |
|
| 53 | 53 | |
| 54 | 54 | // Others |
| 55 | - 'archive', // Wayback machine |
|
| 55 | + 'archive', // Wayback machine |
|
| 56 | 56 | ]; |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | public function __construct(array $deniedList = []) |
| 66 | 66 | { |
| 67 | 67 | if (!empty($deniedList)) { |
| 68 | - $this->deniedList =$deniedList; |
|
| 68 | + $this->deniedList = $deniedList; |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | if (!empty($this->deniedList)) { |
| 89 | - if (preg_match('/(' . implode('|', $this->deniedList). ')/i', $userAgent)) { |
|
| 89 | + if (preg_match('/(' . implode('|', $this->deniedList) . ')/i', $userAgent)) { |
|
| 90 | 90 | return (new Response)->withStatus(self::HTTP_STATUS_CODE); |
| 91 | 91 | } |
| 92 | 92 | } |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | public function __construct(array $fieldList = []) |
| 52 | 52 | { |
| 53 | 53 | if (!empty($fieldList)) { |
| 54 | - $this->fieldList =$fieldList; |
|
| 54 | + $this->fieldList = $fieldList; |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $this->kernel->add(new Driver\RedisDriver($redis)); |
| 270 | 270 | |
| 271 | 271 | // @codeCoverageIgnoreStart |
| 272 | - } catch(RedisException $e) { |
|
| 272 | + } catch (RedisException $e) { |
|
| 273 | 273 | $this->status = false; |
| 274 | 274 | |
| 275 | 275 | echo $e->getMessage(); |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | $this->kernel->add(new Driver\SqliteDriver($pdoInstance)); |
| 313 | 313 | |
| 314 | 314 | // @codeCoverageIgnoreStart |
| 315 | - } catch(PDOException $e) { |
|
| 315 | + } catch (PDOException $e) { |
|
| 316 | 316 | $this->status = false; |
| 317 | 317 | |
| 318 | 318 | echo $e->getMessage(); |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | // Create a PDO instance. |
| 332 | 332 | $pdoInstance = new PDO( |
| 333 | 333 | 'mysql:host=' |
| 334 | - . $mysqlSetting['host'] . ';dbname=' |
|
| 334 | + . $mysqlSetting['host'] . ';dbname=' |
|
| 335 | 335 | . $mysqlSetting['dbname'] . ';charset=' |
| 336 | 336 | . $mysqlSetting['charset'] |
| 337 | 337 | , (string) $mysqlSetting['user'] |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | $this->kernel->add(new Driver\MysqlDriver($pdoInstance)); |
| 343 | 343 | |
| 344 | 344 | // @codeCoverageIgnoreStart |
| 345 | - } catch(PDOException $e) { |
|
| 345 | + } catch (PDOException $e) { |
|
| 346 | 346 | echo $e->getMessage(); |
| 347 | 347 | } |
| 348 | 348 | // @codeCoverageIgnoreEnd |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | protected function setIptablesWatchingFolder(): void |
| 805 | 805 | { |
| 806 | 806 | $iptablesSetting = $this->getOption('config', 'iptables'); |
| 807 | - $this->kernel->setProperty('iptables_watching_folder', $iptablesSetting['watching_folder']); |
|
| 807 | + $this->kernel->setProperty('iptables_watching_folder', $iptablesSetting['watching_folder']); |
|
| 808 | 808 | } |
| 809 | 809 | |
| 810 | 810 | /** |
@@ -841,7 +841,7 @@ discard block |
||
| 841 | 841 | |
| 842 | 842 | $lastResetTime = $cronjobSetting['config']['last_update']; |
| 843 | 843 | |
| 844 | - if (!empty($lastResetTime) ) { |
|
| 844 | + if (!empty($lastResetTime)) { |
|
| 845 | 845 | $lastResetTime = strtotime($lastResetTime); |
| 846 | 846 | } else { |
| 847 | 847 | // @codeCoverageIgnoreStart |
@@ -984,7 +984,7 @@ discard block |
||
| 984 | 984 | if (!empty($ipList)) { |
| 985 | 985 | foreach ($ipList as $ip) { |
| 986 | 986 | |
| 987 | - if (0 === strpos($this->kernel->getCurrentUrl(), $ip['url']) ) { |
|
| 987 | + if (0 === strpos($this->kernel->getCurrentUrl(), $ip['url'])) { |
|
| 988 | 988 | |
| 989 | 989 | if ('allow' === $ip['rule']) { |
| 990 | 990 | $allowedList[] = $ip['ip']; |