diff --git a/LICENSE b/LICENSE index daac9e5b..31425034 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ The MIT License (MIT) Copyright (c) 2014-2019 British Columbia Institute of Technology -Copyright (c) 2019-2021 CodeIgniter Foundation +Copyright (c) 2019-2022 CodeIgniter Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/Config/Filters.php b/app/Config/Filters.php index df90270a..14685207 100644 --- a/app/Config/Filters.php +++ b/app/Config/Filters.php @@ -6,6 +6,8 @@ use CodeIgniter\Filters\CSRF; use CodeIgniter\Filters\DebugToolbar; use CodeIgniter\Filters\Honeypot; +use CodeIgniter\Filters\InvalidChars; +use CodeIgniter\Filters\SecureHeaders; class Filters extends BaseConfig { @@ -16,9 +18,11 @@ class Filters extends BaseConfig * @var array */ public $aliases = [ - 'csrf' => CSRF::class, - 'toolbar' => DebugToolbar::class, - 'honeypot' => Honeypot::class, + 'csrf' => CSRF::class, + 'toolbar' => DebugToolbar::class, + 'honeypot' => Honeypot::class, + 'invalidchars' => InvalidChars::class, + 'secureheaders' => SecureHeaders::class, ]; /** @@ -31,10 +35,12 @@ class Filters extends BaseConfig 'before' => [ // 'honeypot', // 'csrf', + // 'invalidchars', ], 'after' => [ 'toolbar', // 'honeypot', + // 'secureheaders', ], ]; diff --git a/app/Config/Mimes.php b/app/Config/Mimes.php index 973fb398..786bc6a1 100644 --- a/app/Config/Mimes.php +++ b/app/Config/Mimes.php @@ -509,7 +509,7 @@ public static function guessExtensionFromType(string $type, ?string $proposedExt { $type = trim(strtolower($type), '. '); - $proposedExtension = trim(strtolower($proposedExtension)); + $proposedExtension = trim(strtolower($proposedExtension ?? '')); if ($proposedExtension !== '') { if (array_key_exists($proposedExtension, static::$mimes) && in_array($type, is_string(static::$mimes[$proposedExtension]) ? [static::$mimes[$proposedExtension]] : static::$mimes[$proposedExtension], true)) { diff --git a/app/Config/Security.php b/app/Config/Security.php index 563cf2f3..05083f8b 100644 --- a/app/Config/Security.php +++ b/app/Config/Security.php @@ -17,6 +17,17 @@ class Security extends BaseConfig */ public $csrfProtection = 'cookie'; + /** + * -------------------------------------------------------------------------- + * CSRF Token Randomization + * -------------------------------------------------------------------------- + * + * Randomize the CSRF Token for added security. + * + * @var bool + */ + public $tokenRandomize = false; + /** * -------------------------------------------------------------------------- * CSRF Token Name diff --git a/app/Config/Toolbar.php b/app/Config/Toolbar.php index 16a37e83..7183e133 100644 --- a/app/Config/Toolbar.php +++ b/app/Config/Toolbar.php @@ -44,6 +44,18 @@ class Toolbar extends BaseConfig Events::class, ]; + /** + * -------------------------------------------------------------------------- + * Collect Var Data + * -------------------------------------------------------------------------- + * + * If set to false var data from the views will not be colleted. Usefull to + * avoid high memory usage when there are lots of data passed to the view. + * + * @var bool + */ + public $collectVarData = true; + /** * -------------------------------------------------------------------------- * Max History diff --git a/app/Views/errors/html/error_exception.php b/app/Views/errors/html/error_exception.php index 4477ee08..693afed4 100644 --- a/app/Views/errors/html/error_exception.php +++ b/app/Views/errors/html/error_exception.php @@ -195,7 +195,7 @@