Skip to content

Commit 3ebc7d2

Browse files
committed
Release v4.4.7
1 parent 0e4dce8 commit 3ebc7d2

22 files changed

+96
-64
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The MIT License (MIT)
22

33
Copyright (c) 2014-2019 British Columbia Institute of Technology
4-
Copyright (c) 2019-2023 CodeIgniter Foundation
4+
Copyright (c) 2019-2024 CodeIgniter Foundation
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

app/Config/App.php

+24
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,30 @@ class App extends BaseConfig
5959
*/
6060
public string $uriProtocol = 'REQUEST_URI';
6161

62+
/*
63+
|--------------------------------------------------------------------------
64+
| Allowed URL Characters
65+
|--------------------------------------------------------------------------
66+
|
67+
| This lets you specify which characters are permitted within your URLs.
68+
| When someone tries to submit a URL with disallowed characters they will
69+
| get a warning message.
70+
|
71+
| As a security measure you are STRONGLY encouraged to restrict URLs to
72+
| as few characters as possible.
73+
|
74+
| By default, only these are allowed: `a-z 0-9~%.:_-`
75+
|
76+
| Set an empty string to allow all characters -- but only if you are insane.
77+
|
78+
| The configured value is actually a regular expression character group
79+
| and it will be used as: '/\A[<permittedURIChars>]+\z/iu'
80+
|
81+
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
82+
|
83+
*/
84+
public string $permittedURIChars = 'a-z 0-9~%.:_\-';
85+
6286
/**
6387
* --------------------------------------------------------------------------
6488
* Default Locale

app/Config/Cache.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class Cache extends BaseConfig
6161
* ['q'] = Enabled, but only take into account the specified list
6262
* of query parameters.
6363
*
64-
* @var bool|string[]
64+
* @var bool|list<string>
6565
*/
6666
public $cacheQueryString = false;
6767

app/Config/ContentSecurityPolicy.php

+16-16
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,28 @@ class ContentSecurityPolicy extends BaseConfig
4545
/**
4646
* Will default to self if not overridden
4747
*
48-
* @var string|string[]|null
48+
* @var list<string>|string|null
4949
*/
5050
public $defaultSrc;
5151

5252
/**
5353
* Lists allowed scripts' URLs.
5454
*
55-
* @var string|string[]
55+
* @var list<string>|string
5656
*/
5757
public $scriptSrc = 'self';
5858

5959
/**
6060
* Lists allowed stylesheets' URLs.
6161
*
62-
* @var string|string[]
62+
* @var list<string>|string
6363
*/
6464
public $styleSrc = 'self';
6565

6666
/**
6767
* Defines the origins from which images can be loaded.
6868
*
69-
* @var string|string[]
69+
* @var list<string>|string
7070
*/
7171
public $imageSrc = 'self';
7272

@@ -75,36 +75,36 @@ class ContentSecurityPolicy extends BaseConfig
7575
*
7676
* Will default to self if not overridden
7777
*
78-
* @var string|string[]|null
78+
* @var list<string>|string|null
7979
*/
8080
public $baseURI;
8181

8282
/**
8383
* Lists the URLs for workers and embedded frame contents
8484
*
85-
* @var string|string[]
85+
* @var list<string>|string
8686
*/
8787
public $childSrc = 'self';
8888

8989
/**
9090
* Limits the origins that you can connect to (via XHR,
9191
* WebSockets, and EventSource).
9292
*
93-
* @var string|string[]
93+
* @var list<string>|string
9494
*/
9595
public $connectSrc = 'self';
9696

9797
/**
9898
* Specifies the origins that can serve web fonts.
9999
*
100-
* @var string|string[]
100+
* @var list<string>|string
101101
*/
102102
public $fontSrc;
103103

104104
/**
105105
* Lists valid endpoints for submission from `<form>` tags.
106106
*
107-
* @var string|string[]
107+
* @var list<string>|string
108108
*/
109109
public $formAction = 'self';
110110

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

121121
/**
122122
* The frame-src directive restricts the URLs which may
123123
* be loaded into nested browsing contexts.
124124
*
125-
* @var array|string|null
125+
* @var list<string>|string|null
126126
*/
127127
public $frameSrc;
128128

129129
/**
130130
* Restricts the origins allowed to deliver video and audio.
131131
*
132-
* @var string|string[]|null
132+
* @var list<string>|string|null
133133
*/
134134
public $mediaSrc;
135135

136136
/**
137137
* Allows control over Flash and other plugins.
138138
*
139-
* @var string|string[]
139+
* @var list<string>|string
140140
*/
141141
public $objectSrc = 'self';
142142

143143
/**
144-
* @var string|string[]|null
144+
* @var list<string>|string|null
145145
*/
146146
public $manifestSrc;
147147

148148
/**
149149
* Limits the kinds of plugins a page may invoke.
150150
*
151-
* @var string|string[]|null
151+
* @var list<string>|string|null
152152
*/
153153
public $pluginTypes;
154154

155155
/**
156156
* List of actions allowed.
157157
*
158-
* @var string|string[]|null
158+
* @var list<string>|string|null
159159
*/
160160
public $sandbox;
161161

app/Config/Database.php

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class Database extends Config
2323

2424
/**
2525
* The default database connection.
26+
*
27+
* @var array<string, mixed>
2628
*/
2729
public array $default = [
2830
'DSN' => '',
@@ -48,6 +50,8 @@ class Database extends Config
4850
/**
4951
* This database connection is used when
5052
* running PHPUnit database tests.
53+
*
54+
* @var array<string, mixed>
5155
*/
5256
public array $tests = [
5357
'DSN' => '',

app/Config/Exceptions.php

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class Exceptions extends BaseConfig
3030
* --------------------------------------------------------------------------
3131
* Any status codes here will NOT be logged if logging is turned on.
3232
* By default, only 404 (Page Not Found) exceptions are ignored.
33+
*
34+
* @var list<int>
3335
*/
3436
public array $ignoreCodes = [404];
3537

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

app/Config/Filters.php

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ class Filters extends BaseConfig
5555
* If you use this, you should disable auto-routing because auto-routing
5656
* permits any HTTP method to access a controller. Accessing the controller
5757
* with a method you don't expect could bypass the filter.
58+
*
59+
* @var array<string, list<string>>
5860
*/
5961
public array $methods = [];
6062

@@ -64,6 +66,8 @@ class Filters extends BaseConfig
6466
*
6567
* Example:
6668
* 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']]
69+
*
70+
* @var array<string, array<string, list<string>>>
6771
*/
6872
public array $filters = [];
6973
}

app/Config/Format.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Format extends BaseConfig
2222
* These formats are only checked when the data passed to the respond()
2323
* method is an array.
2424
*
25-
* @var string[]
25+
* @var list<string>
2626
*/
2727
public array $supportedResponseFormats = [
2828
'application/json',

app/Config/Logger.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Logger extends BaseConfig
3636
* For a live site you'll usually enable Critical or higher (3) to be logged otherwise
3737
* your log files will fill up very fast.
3838
*
39-
* @var array|int
39+
* @var int|list<int>
4040
*/
4141
public $threshold = (ENVIRONMENT === 'production') ? 4 : 9;
4242

@@ -72,6 +72,8 @@ class Logger extends BaseConfig
7272
*
7373
* Handlers are executed in the order defined in this array, starting with
7474
* the handler on top and continuing down.
75+
*
76+
* @var array<class-string, array<string, int|list<string>|string>>
7577
*/
7678
public array $handlers = [
7779
/*

app/Config/Mimes.php

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class Mimes
2222
{
2323
/**
2424
* Map of extensions to mime types.
25+
*
26+
* @var array<string, list<string>|string>
2527
*/
2628
public static array $mimes = [
2729
'hqx' => [

app/Config/Routing.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class Routing extends BaseRouting
2424
* found taking precedence.
2525
*
2626
* Default: APPPATH . 'Config/Routes.php'
27+
*
28+
* @var list<string>
2729
*/
2830
public array $routeFiles = [
2931
APPPATH . 'Config/Routes.php',
@@ -106,7 +108,7 @@ class Routing extends BaseRouting
106108
* 'blog' => 'Acme\Blog\Controllers',
107109
* ]
108110
*
109-
* @var array [ uri_segment => namespace ]
111+
* @var array<string, string>
110112
*/
111113
public array $moduleRoutes = [];
112114
}

app/Config/Toolbar.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Toolbar extends BaseConfig
3131
* List of toolbar collectors that will be called when Debug Toolbar
3232
* fires up and collects data from.
3333
*
34-
* @var string[]
34+
* @var list<class-string>
3535
*/
3636
public array $collectors = [
3737
Timers::class,
@@ -49,7 +49,7 @@ class Toolbar extends BaseConfig
4949
* Collect Var Data
5050
* --------------------------------------------------------------------------
5151
*
52-
* If set to false var data from the views will not be colleted. Useful to
52+
* If set to false var data from the views will not be collected. Useful to
5353
* avoid high memory usage when there are lots of data passed to the view.
5454
*/
5555
public bool $collectVarData = true;
@@ -99,6 +99,8 @@ class Toolbar extends BaseConfig
9999
* We restrict the values to keep performance as high as possible.
100100
*
101101
* NOTE: The ROOTPATH will be prepended to all values.
102+
*
103+
* @var list<string>
102104
*/
103105
public array $watchedDirectories = [
104106
'app',
@@ -111,6 +113,8 @@ class Toolbar extends BaseConfig
111113
*
112114
* Contains an array of file extensions that will be watched for changes and
113115
* used to determine if the hot-reload feature should reload the page or not.
116+
*
117+
* @var list<string>
114118
*/
115119
public array $watchedExtensions = [
116120
'php', 'css', 'js', 'html', 'svg', 'json', 'env',

app/Config/Validation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Validation extends BaseConfig
1818
* Stores the classes that contain the
1919
* rules that are available.
2020
*
21-
* @var string[]
21+
* @var list<string>
2222
*/
2323
public array $ruleSets = [
2424
Rules::class,

app/Config/View.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
use CodeIgniter\View\ViewDecoratorInterface;
77

88
/**
9-
* @phpstan-type ParserCallable (callable(mixed): mixed)
10-
* @phpstan-type ParserCallableString (callable(mixed): mixed)&string
9+
* @phpstan-type parser_callable (callable(mixed): mixed)
10+
* @phpstan-type parser_callable_string (callable(mixed): mixed)&string
1111
*/
1212
class View extends BaseView
1313
{
@@ -34,8 +34,8 @@ class View extends BaseView
3434
* { title|esc(js) }
3535
* { created_on|date(Y-m-d)|esc(attr) }
3636
*
37-
* @var array<string, string>
38-
* @phpstan-var array<string, ParserCallableString>
37+
* @var array<string, string>
38+
* @phpstan-var array<string, parser_callable_string>
3939
*/
4040
public $filters = [];
4141

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

@@ -56,7 +56,7 @@ class View extends BaseView
5656
*
5757
* All classes must implement CodeIgniter\View\ViewDecoratorInterface
5858
*
59-
* @var class-string<ViewDecoratorInterface>[]
59+
* @var list<class-string<ViewDecoratorInterface>>
6060
*/
6161
public array $decorators = [];
6262
}

app/Controllers/BaseController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ abstract class BaseController extends Controller
3333
* class instantiation. These helpers will be available
3434
* to all other controllers that extend BaseController.
3535
*
36-
* @var array
36+
* @var list<string>
3737
*/
3838
protected $helpers = [];
3939

0 commit comments

Comments
 (0)