Skip to content

Commit

Permalink
Release v4.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Mar 29, 2024
1 parent 7d393f8 commit e6a2f70
Show file tree
Hide file tree
Showing 91 changed files with 501 additions and 310 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The MIT License (MIT)

Copyright (c) 2014-2019 British Columbia Institute of Technology
Copyright (c) 2019-2023 CodeIgniter Foundation
Copyright (c) 2019-2024 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
Expand Down
24 changes: 24 additions & 0 deletions app/Config/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,30 @@ class App extends BaseConfig
*/
public string $uriProtocol = 'REQUEST_URI';

/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify which characters are permitted within your URLs.
| When someone tries to submit a URL with disallowed characters they will
| get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible.
|
| By default, only these are allowed: `a-z 0-9~%.:_-`
|
| Set an empty string to allow all characters -- but only if you are insane.
|
| The configured value is actually a regular expression character group
| and it will be used as: '/\A[<permittedURIChars>]+\z/iu'
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
public string $permittedURIChars = 'a-z 0-9~%.:_\-';

/**
* --------------------------------------------------------------------------
* Default Locale
Expand Down
2 changes: 1 addition & 1 deletion app/Config/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Cache extends BaseConfig
* ['q'] = Enabled, but only take into account the specified list
* of query parameters.
*
* @var bool|string[]
* @var bool|list<string>
*/
public $cacheQueryString = false;

Expand Down
32 changes: 16 additions & 16 deletions app/Config/ContentSecurityPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,28 @@ class ContentSecurityPolicy extends BaseConfig
/**
* Will default to self if not overridden
*
* @var string|string[]|null
* @var list<string>|string|null
*/
public $defaultSrc;

/**
* Lists allowed scripts' URLs.
*
* @var string|string[]
* @var list<string>|string
*/
public $scriptSrc = 'self';

/**
* Lists allowed stylesheets' URLs.
*
* @var string|string[]
* @var list<string>|string
*/
public $styleSrc = 'self';

/**
* Defines the origins from which images can be loaded.
*
* @var string|string[]
* @var list<string>|string
*/
public $imageSrc = 'self';

Expand All @@ -75,36 +75,36 @@ class ContentSecurityPolicy extends BaseConfig
*
* Will default to self if not overridden
*
* @var string|string[]|null
* @var list<string>|string|null
*/
public $baseURI;

/**
* Lists the URLs for workers and embedded frame contents
*
* @var string|string[]
* @var list<string>|string
*/
public $childSrc = 'self';

/**
* Limits the origins that you can connect to (via XHR,
* WebSockets, and EventSource).
*
* @var string|string[]
* @var list<string>|string
*/
public $connectSrc = 'self';

/**
* Specifies the origins that can serve web fonts.
*
* @var string|string[]
* @var list<string>|string
*/
public $fontSrc;

/**
* Lists valid endpoints for submission from `<form>` tags.
*
* @var string|string[]
* @var list<string>|string
*/
public $formAction = 'self';

Expand All @@ -114,48 +114,48 @@ class ContentSecurityPolicy extends BaseConfig
* and `<applet>` tags. This directive can't be used in
* `<meta>` tags and applies only to non-HTML resources.
*
* @var string|string[]|null
* @var list<string>|string|null
*/
public $frameAncestors;

/**
* The frame-src directive restricts the URLs which may
* be loaded into nested browsing contexts.
*
* @var array|string|null
* @var list<string>|string|null
*/
public $frameSrc;

/**
* Restricts the origins allowed to deliver video and audio.
*
* @var string|string[]|null
* @var list<string>|string|null
*/
public $mediaSrc;

/**
* Allows control over Flash and other plugins.
*
* @var string|string[]
* @var list<string>|string
*/
public $objectSrc = 'self';

/**
* @var string|string[]|null
* @var list<string>|string|null
*/
public $manifestSrc;

/**
* Limits the kinds of plugins a page may invoke.
*
* @var string|string[]|null
* @var list<string>|string|null
*/
public $pluginTypes;

/**
* List of actions allowed.
*
* @var string|string[]|null
* @var list<string>|string|null
*/
public $sandbox;

Expand Down
4 changes: 4 additions & 0 deletions app/Config/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class Database extends Config

/**
* The default database connection.
*
* @var array<string, mixed>
*/
public array $default = [
'DSN' => '',
Expand All @@ -48,6 +50,8 @@ class Database extends Config
/**
* This database connection is used when
* running PHPUnit database tests.
*
* @var array<string, mixed>
*/
public array $tests = [
'DSN' => '',
Expand Down
4 changes: 4 additions & 0 deletions app/Config/Exceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class Exceptions extends BaseConfig
* --------------------------------------------------------------------------
* Any status codes here will NOT be logged if logging is turned on.
* By default, only 404 (Page Not Found) exceptions are ignored.
*
* @var list<int>
*/
public array $ignoreCodes = [404];

Expand All @@ -51,6 +53,8 @@ class Exceptions extends BaseConfig
* Any data that you would like to hide from the debug trace.
* In order to specify 2 levels, use "/" to separate.
* ex. ['server', 'setup/password', 'secret_token']
*
* @var list<string>
*/
public array $sensitiveDataInTrace = [];

Expand Down
4 changes: 4 additions & 0 deletions app/Config/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class Filters extends BaseConfig
* If you use this, you should disable auto-routing because auto-routing
* permits any HTTP method to access a controller. Accessing the controller
* with a method you don't expect could bypass the filter.
*
* @var array<string, list<string>>
*/
public array $methods = [];

Expand All @@ -64,6 +66,8 @@ class Filters extends BaseConfig
*
* Example:
* 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']]
*
* @var array<string, array<string, list<string>>>
*/
public array $filters = [];
}
2 changes: 1 addition & 1 deletion app/Config/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Format extends BaseConfig
* These formats are only checked when the data passed to the respond()
* method is an array.
*
* @var string[]
* @var list<string>
*/
public array $supportedResponseFormats = [
'application/json',
Expand Down
4 changes: 3 additions & 1 deletion app/Config/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Logger extends BaseConfig
* For a live site you'll usually enable Critical or higher (3) to be logged otherwise
* your log files will fill up very fast.
*
* @var array|int
* @var int|list<int>
*/
public $threshold = (ENVIRONMENT === 'production') ? 4 : 9;

Expand Down Expand Up @@ -72,6 +72,8 @@ class Logger extends BaseConfig
*
* Handlers are executed in the order defined in this array, starting with
* the handler on top and continuing down.
*
* @var array<class-string, array<string, int|list<string>|string>>
*/
public array $handlers = [
/*
Expand Down
2 changes: 2 additions & 0 deletions app/Config/Mimes.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class Mimes
{
/**
* Map of extensions to mime types.
*
* @var array<string, list<string>|string>
*/
public static array $mimes = [
'hqx' => [
Expand Down
4 changes: 3 additions & 1 deletion app/Config/Routing.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class Routing extends BaseRouting
* found taking precedence.
*
* Default: APPPATH . 'Config/Routes.php'
*
* @var list<string>
*/
public array $routeFiles = [
APPPATH . 'Config/Routes.php',
Expand Down Expand Up @@ -106,7 +108,7 @@ class Routing extends BaseRouting
* 'blog' => 'Acme\Blog\Controllers',
* ]
*
* @var array [ uri_segment => namespace ]
* @var array<string, string>
*/
public array $moduleRoutes = [];
}
8 changes: 6 additions & 2 deletions app/Config/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Toolbar extends BaseConfig
* List of toolbar collectors that will be called when Debug Toolbar
* fires up and collects data from.
*
* @var string[]
* @var list<class-string>
*/
public array $collectors = [
Timers::class,
Expand All @@ -49,7 +49,7 @@ class Toolbar extends BaseConfig
* Collect Var Data
* --------------------------------------------------------------------------
*
* If set to false var data from the views will not be colleted. Useful to
* If set to false var data from the views will not be collected. Useful to
* avoid high memory usage when there are lots of data passed to the view.
*/
public bool $collectVarData = true;
Expand Down Expand Up @@ -99,6 +99,8 @@ class Toolbar extends BaseConfig
* We restrict the values to keep performance as high as possible.
*
* NOTE: The ROOTPATH will be prepended to all values.
*
* @var list<string>
*/
public array $watchedDirectories = [
'app',
Expand All @@ -111,6 +113,8 @@ class Toolbar extends BaseConfig
*
* Contains an array of file extensions that will be watched for changes and
* used to determine if the hot-reload feature should reload the page or not.
*
* @var list<string>
*/
public array $watchedExtensions = [
'php', 'css', 'js', 'html', 'svg', 'json', 'env',
Expand Down
2 changes: 1 addition & 1 deletion app/Config/Validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Validation extends BaseConfig
* Stores the classes that contain the
* rules that are available.
*
* @var string[]
* @var list<string>
*/
public array $ruleSets = [
Rules::class,
Expand Down
14 changes: 7 additions & 7 deletions app/Config/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use CodeIgniter\View\ViewDecoratorInterface;

/**
* @phpstan-type ParserCallable (callable(mixed): mixed)
* @phpstan-type ParserCallableString (callable(mixed): mixed)&string
* @phpstan-type parser_callable (callable(mixed): mixed)
* @phpstan-type parser_callable_string (callable(mixed): mixed)&string
*/
class View extends BaseView
{
Expand All @@ -34,8 +34,8 @@ class View extends BaseView
* { title|esc(js) }
* { created_on|date(Y-m-d)|esc(attr) }
*
* @var array<string, string>
* @phpstan-var array<string, ParserCallableString>
* @var array<string, string>
* @phpstan-var array<string, parser_callable_string>
*/
public $filters = [];

Expand All @@ -44,8 +44,8 @@ class View extends BaseView
* by the core Parser by creating aliases that will be replaced with
* any callable. Can be single or tag pair.
*
* @var array<string, array<string>|callable|string>
* @phpstan-var array<string, array<ParserCallableString>|ParserCallableString|ParserCallable>
* @var array<string, callable|list<string>|string>
* @phpstan-var array<string, list<parser_callable_string>|parser_callable_string|parser_callable>
*/
public $plugins = [];

Expand All @@ -56,7 +56,7 @@ class View extends BaseView
*
* All classes must implement CodeIgniter\View\ViewDecoratorInterface
*
* @var class-string<ViewDecoratorInterface>[]
* @var list<class-string<ViewDecoratorInterface>>
*/
public array $decorators = [];
}
2 changes: 1 addition & 1 deletion app/Controllers/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ abstract class BaseController extends Controller
* class instantiation. These helpers will be available
* to all other controllers that extend BaseController.
*
* @var array
* @var list<string>
*/
protected $helpers = [];

Expand Down
Loading

0 comments on commit e6a2f70

Please sign in to comment.