From 1f2fa2a1b6450964e16176f541e2561f0645799f Mon Sep 17 00:00:00 2001 From: lonnieezell Date: Thu, 16 Jul 2020 03:44:28 +0000 Subject: [PATCH] Release v4.0.4 --- .gitignore | 2 +- app/Config/Autoload.php | 122 +++++++++++++------------------- app/Config/Boot/development.php | 2 +- app/Config/Boot/production.php | 2 +- app/Config/Boot/testing.php | 2 +- app/Config/Events.php | 12 +++- app/Config/Exceptions.php | 5 +- app/Config/Format.php | 16 ++++- app/Config/Honeypot.php | 8 +++ app/Config/Images.php | 2 +- app/Config/Modules.php | 42 +++-------- app/Config/Routes.php | 2 +- app/Config/Services.php | 2 - app/Language/en/Validation.php | 4 ++ app/Views/errors/html/debug.css | 1 + composer.json | 7 +- env | 16 +++-- public/.htaccess | 4 +- spark | 2 +- 19 files changed, 125 insertions(+), 128 deletions(-) create mode 100644 app/Language/en/Validation.php diff --git a/.gitignore b/.gitignore index e82f5252..11abea69 100644 --- a/.gitignore +++ b/.gitignore @@ -84,7 +84,6 @@ phpunit # Composer #------------------------- vendor/ -composer.lock #------------------------- # IDE / Development Files @@ -125,3 +124,4 @@ nb-configuration.xml /results/ /phpunit*.xml /.phpunit.*.cache + diff --git a/app/Config/Autoload.php b/app/Config/Autoload.php index 6a673d31..eaecfdf0 100644 --- a/app/Config/Autoload.php +++ b/app/Config/Autoload.php @@ -1,6 +1,8 @@ - SYSTEMPATH, + * 'App' => APPPATH + * ]; + * + * @var array */ - public function __construct() - { - parent::__construct(); - - /** - * ------------------------------------------------------------------- - * Namespaces - * ------------------------------------------------------------------- - * This maps the locations of any namespaces in your application - * to their location on the file system. These are used by the - * Autoloader to locate files the first time they have been instantiated. - * - * The '/app' and '/system' directories are already mapped for - * you. You may change the name of the 'App' namespace if you wish, - * but this should be done prior to creating any namespaced classes, - * else you will need to modify all of those classes for this to work. - * - * DO NOT change the name of the CodeIgniter namespace or your application - * WILL break. * - * Prototype: - * - * $Config['psr4'] = [ - * 'CodeIgniter' => SYSPATH - * `]; - */ - $psr4 = [ - 'App' => APPPATH, // To ensure filters, etc still found, - APP_NAMESPACE => APPPATH, // For custom namespace - 'Config' => APPPATH . 'Config', - ]; - - /** - * ------------------------------------------------------------------- - * Class Map - * ------------------------------------------------------------------- - * The class map provides a map of class names and their exact - * location on the drive. Classes loaded in this manner will have - * slightly faster performance because they will not have to be - * searched for within one or more directories as they would if they - * were being autoloaded through a namespace. - * - * Prototype: - * - * $Config['classmap'] = [ - * 'MyClass' => '/path/to/class/file.php' - * ]; - */ - $classmap = []; - - //-------------------------------------------------------------------- - // Do Not Edit Below This Line - //-------------------------------------------------------------------- - - $this->psr4 = array_merge($this->psr4, $psr4); - $this->classmap = array_merge($this->classmap, $classmap); - - unset($psr4, $classmap); - } - - //-------------------------------------------------------------------- + public $psr4 = [ + APP_NAMESPACE => APPPATH, // For custom app namespace + 'Config' => APPPATH . 'Config', + ]; + /** + * ------------------------------------------------------------------- + * Class Map + * ------------------------------------------------------------------- + * The class map provides a map of class names and their exact + * location on the drive. Classes loaded in this manner will have + * slightly faster performance because they will not have to be + * searched for within one or more directories as they would if they + * were being autoloaded through a namespace. + * + * Prototype: + * + * $classmap = [ + * 'MyClass' => '/path/to/class/file.php' + * ]; + * + * @var array + */ + public $classmap = []; } diff --git a/app/Config/Boot/development.php b/app/Config/Boot/development.php index 7d6ae48d..63fdd88b 100644 --- a/app/Config/Boot/development.php +++ b/app/Config/Boot/development.php @@ -29,4 +29,4 @@ | items. It can always be used within your own application too. */ -defined('CI_DEBUG') || define('CI_DEBUG', 1); +defined('CI_DEBUG') || define('CI_DEBUG', true); diff --git a/app/Config/Boot/production.php b/app/Config/Boot/production.php index c54bdbdd..1241907c 100644 --- a/app/Config/Boot/production.php +++ b/app/Config/Boot/production.php @@ -19,4 +19,4 @@ | release of the framework. */ -defined('CI_DEBUG') || define('CI_DEBUG', 0); +defined('CI_DEBUG') || define('CI_DEBUG', false); diff --git a/app/Config/Boot/testing.php b/app/Config/Boot/testing.php index e6c94d71..fab6c074 100644 --- a/app/Config/Boot/testing.php +++ b/app/Config/Boot/testing.php @@ -30,4 +30,4 @@ | release of the framework. */ -defined('CI_DEBUG') || define('CI_DEBUG', 1); +defined('CI_DEBUG') || define('CI_DEBUG', true); diff --git a/app/Config/Events.php b/app/Config/Events.php index 085cc4ac..14bfd321 100644 --- a/app/Config/Events.php +++ b/app/Config/Events.php @@ -1,6 +1,7 @@ 0) + if (ini_get('zlib.output_compression')) { - \ob_end_flush(); + throw FrameworkException::forEnabledZlibOutputCompression(); } - \ob_start(function ($buffer) { + while (ob_get_level() > 0) + { + ob_end_flush(); + } + + ob_start(function ($buffer) { return $buffer; }); } diff --git a/app/Config/Exceptions.php b/app/Config/Exceptions.php index c0245b2a..5fe33d31 100644 --- a/app/Config/Exceptions.php +++ b/app/Config/Exceptions.php @@ -1,12 +1,13 @@ \CodeIgniter\Format\XMLFormatter::class, 'text/xml' => \CodeIgniter\Format\XMLFormatter::class, ]; - + + /* + |-------------------------------------------------------------------------- + | Formatters Options + |-------------------------------------------------------------------------- + | + | Additional Options to adjust default formatters behaviour. + | For each mime type, list the additional options that should be used. + | + */ + public $formatterOptions = [ + 'application/json' => JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES, + 'application/xml' => 0, + 'text/xml' => 0, + ]; //-------------------------------------------------------------------- /** diff --git a/app/Config/Honeypot.php b/app/Config/Honeypot.php index f4444a5d..3d9e3726 100644 --- a/app/Config/Honeypot.php +++ b/app/Config/Honeypot.php @@ -11,6 +11,7 @@ class Honeypot extends BaseConfig * @var boolean */ public $hidden = true; + /** * Honeypot Label Content * @@ -31,4 +32,11 @@ class Honeypot extends BaseConfig * @var string */ public $template = ''; + + /** + * Honeypot container + * + * @var string + */ + public $container = '
{template}
'; } diff --git a/app/Config/Images.php b/app/Config/Images.php index 730ddee7..a416b8b8 100644 --- a/app/Config/Images.php +++ b/app/Config/Images.php @@ -22,7 +22,7 @@ class Images extends BaseConfig /** * The available handler classes. * - * @var array + * @var \CodeIgniter\Images\Handlers\BaseHandler[] */ public $handlers = [ 'gd' => \CodeIgniter\Images\Handlers\GDHandler::class, diff --git a/app/Config/Modules.php b/app/Config/Modules.php index 28bbc7d9..40cb9875 100644 --- a/app/Config/Modules.php +++ b/app/Config/Modules.php @@ -1,7 +1,10 @@ -enabled) - { - return false; - } - - $alias = strtolower($alias); - - return in_array($alias, $this->activeExplorers); - } } diff --git a/app/Config/Routes.php b/app/Config/Routes.php index a2a9654b..56839ca2 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -38,7 +38,7 @@ * -------------------------------------------------------------------- * * There will often be times that you need additional routing and you - * need to it be able to override any defaults in this file. Environment + * need it to be able to override any defaults in this file. Environment * based routes is one such time. require() additional route files here * to make that happen. * diff --git a/app/Config/Services.php b/app/Config/Services.php index fb85a734..c58da709 100644 --- a/app/Config/Services.php +++ b/app/Config/Services.php @@ -2,8 +2,6 @@ use CodeIgniter\Config\Services as CoreServices; -require_once SYSTEMPATH . 'Config/Services.php'; - /** * Services Configuration file. * diff --git a/app/Language/en/Validation.php b/app/Language/en/Validation.php new file mode 100644 index 00000000..54d1e7a4 --- /dev/null +++ b/app/Language/en/Validation.php @@ -0,0 +1,4 @@ +{label}' +# honeypot.hidden = 'true' +# honeypot.label = 'Fill This Field' +# honeypot.name = 'honeypot' +# honeypot.template = '' +# honeypot.container = '
{template}
' diff --git a/public/.htaccess b/public/.htaccess index 699e1c1f..02026a3f 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -18,7 +18,7 @@ Options All -Indexes # Redirect Trailing Slashes... RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^(.*)/$ /$1 [L,R=301] + RewriteRule ^(.*)/$ /$1 [L,R=301] # Rewrite "www.example.com -> example.com" RewriteCond %{HTTPS} !=on @@ -30,7 +30,7 @@ Options All -Indexes # request to the front controller, index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^(.*)$ index.php/$1 [L] + RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA] # Ensure Authorization header is passed along RewriteCond %{HTTP:Authorization} . diff --git a/spark b/spark index 396ad59c..0a0908d9 100755 --- a/spark +++ b/spark @@ -24,7 +24,7 @@ define('SPARKED', true); */ // Refuse to run when called from php-cgi -if (substr(php_sapi_name(), 0, 3) === 'cgi') +if (strpos(php_sapi_name(), 'cgi') === 0) { die("The cli tool is not supported when running php-cgi. It needs php-cli to function!\n\n"); }