@@ -89,13 +89,13 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | $this->deniedRegexList = [ |
| 91 | 91 | 'javascript\s*:', |
| 92 | - '\bon\w+=\S+(?=.*>)', // Inline JavaScript. |
|
| 92 | + '\bon\w+=\S+(?=.*>)', // Inline JavaScript. |
|
| 93 | 93 | '(document|(document\.)?window)\.(location|on\w*)', |
| 94 | 94 | 'expression\s*(\(|&\#40;)', // CSS and IE |
| 95 | - 'vbscript\s*:', // IE, surprise! |
|
| 96 | - 'wscript\s*:', // IE |
|
| 97 | - 'jscript\s*:', // IE |
|
| 98 | - 'vbs\s*:', // IE |
|
| 95 | + 'vbscript\s*:', // IE, surprise! |
|
| 96 | + 'wscript\s*:', // IE |
|
| 97 | + 'jscript\s*:', // IE |
|
| 98 | + 'vbs\s*:', // IE |
|
| 99 | 99 | 'Redirect\s+30\d:', |
| 100 | 100 | "([\"'])?data\s*:[^\\1]*?base64[^\\1]*?,[^\\1]*?\\1?", |
| 101 | 101 | ]; |
@@ -222,9 +222,9 @@ discard block |
||
| 222 | 222 | */ |
| 223 | 223 | $words = [ |
| 224 | 224 | 'javascript', 'expression', 'vbscript', 'jscript', 'wscript', |
| 225 | - 'vbs', 'script', 'base64', 'applet', 'alert', |
|
| 226 | - 'document', 'write', 'cookie', 'window', 'confirm', |
|
| 227 | - 'prompt', 'eval', |
|
| 225 | + 'vbs', 'script', 'base64', 'applet', 'alert', |
|
| 226 | + 'document', 'write', 'cookie', 'window', 'confirm', |
|
| 227 | + 'prompt', 'eval', |
|
| 228 | 228 | ]; |
| 229 | 229 | |
| 230 | 230 | foreach ($words as $word) { |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | ); |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | - } while($original !== $str); |
|
| 282 | + } while ($original !== $str); |
|
| 283 | 283 | |
| 284 | 284 | unset($original); |
| 285 | 285 | |
@@ -581,17 +581,17 @@ discard block |
||
| 581 | 581 | "'", '"', '&', '$', '#', |
| 582 | 582 | '{', '}', '[', ']', '=', |
| 583 | 583 | ';', '?', '%20', '%22', |
| 584 | - '%3c', // < |
|
| 585 | - '%253c', // < |
|
| 586 | - '%3e', // > |
|
| 587 | - '%0e', // > |
|
| 588 | - '%28', // ( |
|
| 589 | - '%29', // ) |
|
| 590 | - '%2528', // ( |
|
| 591 | - '%26', // & |
|
| 592 | - '%24', // $ |
|
| 593 | - '%3f', // ? |
|
| 594 | - '%3b', // ; |
|
| 584 | + '%3c', // < |
|
| 585 | + '%253c', // < |
|
| 586 | + '%3e', // > |
|
| 587 | + '%0e', // > |
|
| 588 | + '%28', // ( |
|
| 589 | + '%29', // ) |
|
| 590 | + '%2528', // ( |
|
| 591 | + '%26', // & |
|
| 592 | + '%24', // $ |
|
| 593 | + '%3f', // ? |
|
| 594 | + '%3b', // ; |
|
| 595 | 595 | '%3d' // = |
| 596 | 596 | ]; |
| 597 | 597 | |
@@ -637,19 +637,19 @@ discard block |
||
| 637 | 637 | protected function sanitizeNaughtyHtml(array $matches): string |
| 638 | 638 | { |
| 639 | 639 | static $naughtyTags = [ |
| 640 | - 'alert', 'prompt', 'confirm', 'applet', 'audio', |
|
| 641 | - 'basefont', 'base', 'behavior', 'bgsound', 'blink', |
|
| 642 | - 'body', 'embed', 'expression', 'form', 'frameset', |
|
| 643 | - 'frame', 'head', 'html', 'ilayer', 'iframe', |
|
| 644 | - 'input', 'button', 'select', 'isindex', 'layer', |
|
| 645 | - 'link', 'meta', 'keygen', 'object', 'plaintext', |
|
| 646 | - 'style', 'script', 'textarea', 'title', 'math', |
|
| 647 | - 'video', 'svg', 'xml', 'xss', |
|
| 640 | + 'alert', 'prompt', 'confirm', 'applet', 'audio', |
|
| 641 | + 'basefont', 'base', 'behavior', 'bgsound', 'blink', |
|
| 642 | + 'body', 'embed', 'expression', 'form', 'frameset', |
|
| 643 | + 'frame', 'head', 'html', 'ilayer', 'iframe', |
|
| 644 | + 'input', 'button', 'select', 'isindex', 'layer', |
|
| 645 | + 'link', 'meta', 'keygen', 'object', 'plaintext', |
|
| 646 | + 'style', 'script', 'textarea', 'title', 'math', |
|
| 647 | + 'video', 'svg', 'xml', 'xss', |
|
| 648 | 648 | ]; |
| 649 | 649 | |
| 650 | 650 | static $evilAttributes = [ |
| 651 | - 'on\w+', 'style', 'xmlns', 'seekSegmentTime', |
|
| 652 | - 'form', 'xlink:href', 'FSCommand', 'formaction', |
|
| 651 | + 'on\w+', 'style', 'xmlns', 'seekSegmentTime', |
|
| 652 | + 'form', 'xlink:href', 'FSCommand', 'formaction', |
|
| 653 | 653 | ]; |
| 654 | 654 | |
| 655 | 655 | // First, escape unclosed tags |
@@ -706,7 +706,7 @@ discard block |
||
| 706 | 706 | |
| 707 | 707 | $attributes = empty($attributes) |
| 708 | 708 | ? '' |
| 709 | - : ' '.implode(' ', $attributes); |
|
| 709 | + : ' ' . implode(' ', $attributes); |
|
| 710 | 710 | return '<' . $matches['slash'] . $matches['tagName'] . $attributes . '>'; |
| 711 | 711 | } |
| 712 | 712 | |
@@ -167,7 +167,7 @@ |
||
| 167 | 167 | $masked = implode('.', $tmp); |
| 168 | 168 | |
| 169 | 169 | } else { |
| 170 | - $masked = str_repeat('*', strlen($str) - 6) . substr(str, -6); |
|
| 170 | + $masked = str_repeat('*', strlen($str) - 6) . substr(str, -6); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | return $masked; |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | |
| 57 | 57 | if ( |
| 58 | 58 | // Default password, unencrypted. |
| 59 | - $admin['user'] === $postParams['s_user'] && |
|
| 59 | + $admin['user'] === $postParams['s_user'] && |
|
| 60 | 60 | 'shieldon_pass' === $postParams['s_pass'] && |
| 61 | 61 | 'shieldon_pass' === $admin['pass'] |
| 62 | 62 | ) { |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | <div class="filter-status"> |
| 204 | 204 | <div class="heading"><?php _e('panel', 'overview_label_action_logger', 'Action Logger'); ?></div> |
| 205 | 205 | <div class="nums"> |
| 206 | - <?php echo $data['action_logger'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
| 206 | + <?php echo $data['action_logger'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
| 207 | 207 | </div> |
| 208 | 208 | <div class="note"><?php _e('panel', 'overview_note_action_logger', 'Record every visitor’s behavior.'); ?></div> |
| 209 | 209 | </div> |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | <div class="filter-status"> |
| 223 | 223 | <div class="heading"><?php _e('panel', 'overview_label_recaptcha', 'reCAPTCHA'); ?></div> |
| 224 | 224 | <div class="nums"> |
| 225 | - <?php echo $captcha['recaptcha'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
| 225 | + <?php echo $captcha['recaptcha'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
| 226 | 226 | </div> |
| 227 | 227 | <div class="note"><?php _e('panel', 'overview_note_recaptcha', 'Provided by Google.'); ?></div> |
| 228 | 228 | </div> |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | <div class="filter-status"> |
| 232 | 232 | <div class="heading"><?php _e('panel', 'overview_label_image_captcha', 'Image Captcha'); ?></div> |
| 233 | 233 | <div class="nums"> |
| 234 | - <?php echo $captcha['imagecaptcha'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
| 234 | + <?php echo $captcha['imagecaptcha'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
| 235 | 235 | </div> |
| 236 | 236 | <div class="note"><?php _e('panel', 'overview_note_image_captcha', 'A simple text-in-image Captcha.'); ?></div> |
| 237 | 237 | </div> |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | <div class="filter-status"> |
| 252 | 252 | <div class="heading"><?php _e('panel', 'overview_label_' . $k, ''); ?></div> |
| 253 | 253 | <div class="nums"> |
| 254 | - <?php echo $messengers[$k] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
| 254 | + <?php echo $messengers[$k] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
| 255 | 255 | </div> |
| 256 | 256 | <div class="note"><?php _e('panel', 'overview_note_' . $k, ''); ?></div> |
| 257 | 257 | </div> |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | * |
| 341 | 341 | * @return void |
| 342 | 342 | */ |
| 343 | - public function __construct(?ServerRequestInterface $request = null, ?ResponseInterface $response = null) |
|
| 343 | + public function __construct(?ServerRequestInterface $request = null, ?ResponseInterface $response = null) |
|
| 344 | 344 | { |
| 345 | 345 | // Load helper functions. This is the must. |
| 346 | 346 | new Helpers(); |
@@ -1648,10 +1648,10 @@ discard block |
||
| 1648 | 1648 | |
| 1649 | 1649 | $ui = [ |
| 1650 | 1650 | 'background_image' => $this->dialogUI['background_image'] ?? '', |
| 1651 | - 'bg_color' => $this->dialogUI['bg_color'] ?? '#ffffff', |
|
| 1652 | - 'header_bg_color' => $this->dialogUI['header_bg_color'] ?? '#212531', |
|
| 1653 | - 'header_color' => $this->dialogUI['header_color'] ?? '#ffffff', |
|
| 1654 | - 'shadow_opacity' => $this->dialogUI['shadow_opacity'] ?? '0.2', |
|
| 1651 | + 'bg_color' => $this->dialogUI['bg_color'] ?? '#ffffff', |
|
| 1652 | + 'header_bg_color' => $this->dialogUI['header_bg_color'] ?? '#212531', |
|
| 1653 | + 'header_color' => $this->dialogUI['header_color'] ?? '#ffffff', |
|
| 1654 | + 'shadow_opacity' => $this->dialogUI['shadow_opacity'] ?? '0.2', |
|
| 1655 | 1655 | ]; |
| 1656 | 1656 | |
| 1657 | 1657 | if (!defined('SHIELDON_VIEW')) { |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | * |
| 49 | 49 | * @return bool |
| 50 | 50 | */ |
| 51 | - public function __call($function , $args) |
|
| 51 | + public function __call($function, $args) |
|
| 52 | 52 | { |
| 53 | 53 | $className = 'Shieldon\Firewall\Panel\Sandbox\\' . $function; |
| 54 | 54 | |
@@ -30,11 +30,11 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public static function get(array $setting): MessengerInterface |
| 32 | 32 | { |
| 33 | - $sender = $setting['config']['sender'] ?? ''; |
|
| 33 | + $sender = $setting['config']['sender'] ?? ''; |
|
| 34 | 34 | $recipients = $setting['config']['recipients'] ?? []; |
| 35 | - $host = $setting['config']['host'] ?? ''; |
|
| 36 | - $user = $setting['config']['user'] ?? ''; |
|
| 37 | - $pass = $setting['config']['pass'] ?? ''; |
|
| 35 | + $host = $setting['config']['host'] ?? ''; |
|
| 36 | + $user = $setting['config']['user'] ?? ''; |
|
| 37 | + $pass = $setting['config']['pass'] ?? ''; |
|
| 38 | 38 | $port = $setting['config']['port'] ?? ''; |
| 39 | 39 | |
| 40 | 40 | $instance = new Smtp($user, $pass, $host, (int) $port); |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | public static function get(array $setting): MessengerInterface |
| 31 | 31 | { |
| 32 | 32 | $botToken = $setting['config']['bot_token'] ?? ''; |
| 33 | - $channel = $setting['config']['channel'] ?? ''; |
|
| 33 | + $channel = $setting['config']['channel'] ?? ''; |
|
| 34 | 34 | |
| 35 | 35 | return new Slack($botToken, $channel); |
| 36 | 36 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public static function get(array $setting): MessengerInterface |
| 32 | 32 | { |
| 33 | - $sender = $setting['config']['sender'] ?? ''; |
|
| 33 | + $sender = $setting['config']['sender'] ?? ''; |
|
| 34 | 34 | $recipients = $setting['config']['recipients'] ?? []; |
| 35 | 35 | |
| 36 | 36 | $instance = new Mail(); |