Skip to content

Commit 4b71437

Browse files
authored
Merge pull request #8098 from codeigniter4/develop
4.4.3 Ready code
2 parents cf43310 + 2b3ec1a commit 4b71437

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+467
-129
lines changed

.github/workflows/test-scss.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
uses: actions/checkout@v4
3737

3838
- name: Setup Node
39-
uses: actions/setup-node@v3.0.0
39+
uses: actions/setup-node@v4.0.0
4040
with:
4141
# node version based on dart-sass test workflow
4242
node-version: 16

CHANGELOG.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
# Changelog
22

3-
## [v4.4.2](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.1) (2023-10-19)
3+
## [v4.4.3](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.3) (2023-10-26)
4+
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.2...v4.4.3)
5+
6+
### SECURITY
7+
8+
* *Detailed Error Report is Displayed in Production Environment* was fixed. See the [Security advisory](https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-hwxf-qxj7-7rfj) for more information.
9+
10+
### Fixed Bugs
11+
12+
* fix: FilterTestTrait::getFilterCaller() does not support Filter classes as array by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8058
13+
* fix: add dbgroup to model template only when specified as an option by @sammyskills in https://github.com/codeigniter4/CodeIgniter4/pull/8077
14+
* Update phpstan-codeigniter and fix errors on Modules by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/8036
15+
* fix: [Validation] exact_length does not pass int values by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8088
16+
* fix: [Table] field named `data` will produce bugged output by @ping-yee in https://github.com/codeigniter4/CodeIgniter4/pull/8054
17+
* docs: fix event points descriptions by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8076
18+
* docs: fix helper loading by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8084
19+
20+
## [v4.4.2](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.2) (2023-10-19)
421
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.1...v4.4.2)
522

623
### Fixed Bugs

admin/RELEASE.md

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
If you release a new minor version.
1212

13-
* Create PR to merge `4.x` into `develop` and merge it
14-
* Rename the current minor version (e.g., `4.4`) in Setting > Branches >
13+
* [ ] Create PR to merge `4.x` into `develop` and merge it
14+
* [ ] Rename the current minor version (e.g., `4.4`) in Setting > Branches >
1515
"Branch protection rules" to the next minor version. E.g. `4.4``4.5`
16-
* Delete the merged `4.x` branch (This closes all PRs to the branch)
17-
* Do the regular release process. Go to the next "Changelog" section
16+
* [ ] Delete the merged `4.x` branch (This closes all PRs to the branch)
17+
* [ ] Do the regular release process. Go to the next "Changelog" section
1818

1919
## Changelog
2020

@@ -48,47 +48,57 @@ the existing content.
4848

4949
## Preparation
5050

51-
* Work off direct clones of the repos so the release branches persist for a time
52-
* Clone both **codeigniter4/CodeIgniter4** and **codeigniter4/userguide** and
51+
Work off direct clones of the repos so the release branches persist for a time.
52+
53+
* [ ] Clone both **codeigniter4/CodeIgniter4** and **codeigniter4/userguide** and
5354
resolve any necessary PRs
5455
```console
5556
git clone [email protected]:codeigniter4/CodeIgniter4.git
5657
git clone [email protected]:codeigniter4/userguide.git
5758
```
58-
* Vet the **admin/** folders for any removed hidden files (Action deploy scripts
59+
* [ ] Vet the **admin/** folders for any removed hidden files (Action deploy scripts
5960
*do not remove these*)
6061
* git diff --name-status origin/master admin/
61-
* Merge any Security Advisory PRs in private forks
62+
* [ ] Merge any Security Advisory PRs in private forks
6263

6364
## Process
6465

6566
> **Note** Most changes that need noting in the User Guide and docs should have
6667
> been included with their PR, so this process assumes you will not be
6768
> generating much new content.
6869

69-
* Create a new branch `release-4.x.x`
70-
* Update **system/CodeIgniter.php** with the new version number:
70+
* [ ] Create a new branch `release-4.x.x`
71+
* [ ] Update **system/CodeIgniter.php** with the new version number:
7172
`const CI_VERSION = '4.x.x';`
72-
* Update **user_guide_src/source/conf.py** with the new `version = '4.x'` (if applicable)
73+
* [ ] Update **user_guide_src/source/conf.py** with the new `version = '4.x'` (if applicable)
7374
and `release = '4.x.x'`
74-
* Replace **CHANGELOG.md** with the new version generated above
75-
* Update **user_guide_src/source/changelogs/{version}.rst**
75+
* [ ] Replace **CHANGELOG.md** with the new version generated above
76+
* [ ] Update **user_guide_src/source/changelogs/{version}.rst**
7677
* Set the date to format `Release Date: January 31, 2021`
7778
* Remove the section titles that have no items
78-
* Update **user_guide_src/source/installation/upgrade_{ver}.rst**
79+
* [ ] Update **user_guide_src/source/installation/upgrade_{ver}.rst**
7980
* fill in the "All Changes" section, and add it to **upgrading.rst**
8081
* git diff --name-status origin/master -- . ':!system'
8182
* Remove the section titles that have no items
8283
* [Minor version only] Update the "from" version in the title. E.g., `from 4.3.x` → `from 4.3.8`
83-
* Commit the changes with `Prep for 4.x.x release` and push to origin
84-
* Create a new PR from `release-4.x.x` to `develop`:
84+
* [ ] Commit the changes with `Prep for 4.x.x release` and push to origin
85+
* [ ] Create a new PR from `release-4.x.x` to `develop`:
8586
* Title: `Prep for 4.x.x release`
86-
* Decription: `Updates changelog and version references for 4.x.x.` (plus checklist)
87-
* Let all tests run, then review and merge the PR
88-
* Create a new PR from `develop` to `master`:
87+
* Description:
88+
```
89+
Updates changelog and version references for 4.x.x.
90+
91+
Previous version: #xxxx
92+
Release Code: TODO
93+
New Changelog: TODO
94+
```
95+
(plus checklist)
96+
* [ ] Let all tests run, then review and merge the PR
97+
* [ ] Create a new PR from `develop` to `master`:
8998
* Title: `4.x.x Ready code`
9099
* Description: blank
91-
* Merge the PR then create a new Release:
100+
* [ ] Merge the PR and wait for all tests.
101+
* [ ] Create a new Release:
92102
* Tag: `v4.x.x` (Create new tag)
93103
* Target: `master`
94104
* Title: `CodeIgniter 4.x.x`
@@ -103,53 +113,54 @@ the existing content.
103113

104114
**Full Changelog**: https://github.com/codeigniter4/CodeIgniter4/compare/v4.x.x...v4.x.x
105115
```
106-
* Watch for the "Deploy Distributable Repos" action to make sure **framework**,
116+
Click the "Generate release notes" button, and get the "New Contributors".
117+
* [ ] Watch for the "Deploy Distributable Repos" action to make sure **framework**,
107118
**appstarter**, and **userguide** get updated
108-
* Run the following commands to install and test `appstarter` and verify the new
119+
* [ ] Run the following commands to install and test `appstarter` and verify the new
109120
version:
110121
```console
111122
composer create-project codeigniter4/appstarter release-test
112123
cd release-test
113124
composer test && composer info codeigniter4/framework
114125
```
115-
* Verify that the user guide actions succeeded:
126+
* [ ] Verify that the user guide actions succeeded:
116127
* "[Deploy Distributable Repos](https://github.com/codeigniter4/CodeIgniter4/actions/workflows/deploy-distributables.yml)", the main repo
117128
* "[Deploy Production](https://github.com/codeigniter4/userguide/actions/workflows/deploy.yml)", UG repo
118129
* "[pages-build-deployment](https://github.com/codeigniter4/userguide/actions/workflows/pages/pages-build-deployment)", UG repo
119130
* Check if "CodeIgniter4.x.x.epub" is added to UG repo. "CodeIgniter.epub" was
120131
created when v4.3.8 was released.
121-
* Fast-forward `develop` branch to catch the merge commit from `master`
132+
* [ ] Fast-forward `develop` branch to catch the merge commit from `master`
122133
```console
123134
git fetch origin
124135
git checkout develop
125136
git merge origin/develop
126137
git merge origin/master
127138
git push origin HEAD
128139
```
129-
* Update the next minor upgrade branch `4.x`:
140+
* [ ] Update the next minor upgrade branch `4.x`:
130141
```console
131142
git fetch origin
132143
git checkout 4.x
133144
git merge origin/4.x
134145
git merge origin/develop
135146
git push origin HEAD
136147
```
137-
* [Minor version only] Create the next minor upgrade branch `4.x`:
148+
* [ ] [Minor version only] Create the next minor upgrade branch `4.x`:
138149
```console
139150
git fetch origin
140151
git switch develop
141152
git switch -c 4.x
142153
git push origin HEAD
143154
```
144-
* Publish any Security Advisories that were resolved from private forks
155+
* [ ] Publish any Security Advisories that were resolved from private forks
145156
(note: publishing is restricted to administrators):
146-
* Announce the release on the forums and Slack channel
157+
* [ ] Announce the release on the forums and Slack channel
147158
(note: this forum is restricted to administrators):
148159
* Make a new topic in the "News & Discussion" forums:
149160
https://forum.codeigniter.com/forum-2.html
150161
* The content is somewhat organic, but should include any major features and
151162
changes as well as a link to the User Guide's changelog
152-
* Create a PR for new changelog and upgrade for the next version
163+
* [ ] Create a PR for new changelog and upgrade for the next version
153164
* Create **user_guide_src/source/changelogs/{next_version}.rst** and add it to
154165
**index.rst** (See **next-changelog-*.rst**)
155166
* Create **user_guide_src/source/installation/upgrade_{next_version}.rst** and add it to

app/Config/Boot/development.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
| In development, we want to show as many errors as possible to help
88
| make sure they don't make it to production. And save us hours of
99
| painful debugging.
10+
|
11+
| If you set 'display_errors' to '1', CI4's detailed error report will show.
1012
*/
1113
error_reporting(-1);
1214
ini_set('display_errors', '1');

app/Config/Boot/production.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
|--------------------------------------------------------------------------
77
| Don't show ANY in production environments. Instead, let the system catch
88
| it and display a generic error message.
9+
|
10+
| If you set 'display_errors' to '1', CI4's detailed error report will show.
911
*/
1012
ini_set('display_errors', '0');
1113
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);

app/Config/Boot/testing.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/*
4+
* The environment testing is reserved for PHPUnit testing. It has special
5+
* conditions built into the framework at various places to assist with that.
6+
* You can’t use it for your development.
7+
*/
8+
39
/*
410
|--------------------------------------------------------------------------
511
| ERROR DISPLAY

app/Config/Filters.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ class Filters extends BaseConfig
1515
* Configures aliases for Filter classes to
1616
* make reading things nicer and simpler.
1717
*
18-
* @var array<string, string>
19-
* @phpstan-var array<string, class-string>
18+
* @var array<string, array<int, string>|string> [filter_name => classname]
19+
* or [filter_name => [classname1, classname2, ...]]
20+
* @phpstan-var array<string, class-string|list<class-string>>
2021
*/
2122
public array $aliases = [
2223
'csrf' => CSRF::class,

app/Views/errors/html/error_404.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<?= nl2br(esc($message)) ?>
7878
<?php else : ?>
7979
<?= lang('Errors.sorryCannotFind') ?>
80-
<?php endif ?>
80+
<?php endif; ?>
8181
</p>
8282
</div>
8383
</body>

app/Views/errors/html/error_exception.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<?php endif; ?>
4545
</div>
4646

47+
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) : ?>
4748
<div class="container">
4849

4950
<ul class="tabs" id="tabs">
@@ -66,7 +67,7 @@
6667
<li>
6768
<p>
6869
<!-- Trace info -->
69-
<?php if (isset($row['file']) && is_file($row['file'])) :?>
70+
<?php if (isset($row['file']) && is_file($row['file'])) : ?>
7071
<?php
7172
if (isset($row['function']) && in_array($row['function'], ['include', 'include_once', 'require', 'require_once'], true)) {
7273
echo esc($row['function'] . ' ' . clean_path($row['file']));
@@ -375,14 +376,16 @@
375376
</div> <!-- /tab-content -->
376377

377378
</div> <!-- /container -->
379+
<?php endif; ?>
378380

379381
<div class="footer">
380382
<div class="container">
381383

382384
<p>
383385
Displayed at <?= esc(date('H:i:sa')) ?> &mdash;
384386
PHP: <?= esc(PHP_VERSION) ?> &mdash;
385-
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?>
387+
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?> --
388+
Environment: <?= ENVIRONMENT ?>
386389
</p>
387390

388391
</div>

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"require-dev": {
2121
"codeigniter/coding-standard": "^1.5",
22-
"codeigniter/phpstan-codeigniter": "^v1.1",
22+
"codeigniter/phpstan-codeigniter": "^1.4",
2323
"ergebnis/composer-normalize": "^2.28",
2424
"fakerphp/faker": "^1.9",
2525
"kint-php/kint": "^5.0.4",
@@ -33,7 +33,7 @@
3333
"phpunit/phpcov": "^8.2",
3434
"phpunit/phpunit": "^9.1",
3535
"predis/predis": "^1.1 || ^2.0",
36-
"rector/rector": "0.18.5",
36+
"rector/rector": "0.18.6",
3737
"vimeo/psalm": "^5.0"
3838
},
3939
"suggest": {

phpstan-baseline.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -871,16 +871,6 @@
871871
'count' => 4,
872872
'path' => __DIR__ . '/system/Config/BaseConfig.php',
873873
];
874-
$ignoreErrors[] = [
875-
'message' => '#^Argument \\#1 \\$name \\(\'Config\\\\\\\\Modules\'\\) passed to function config does not extend CodeIgniter\\\\\\\\Config\\\\\\\\BaseConfig\\.$#',
876-
'count' => 1,
877-
'path' => __DIR__ . '/system/Config/BaseConfig.php',
878-
];
879-
$ignoreErrors[] = [
880-
'message' => '#^Argument \\#1 \\$name \\(\'Config\\\\\\\\Modules\'\\) passed to function config does not extend CodeIgniter\\\\\\\\Config\\\\\\\\BaseConfig\\.$#',
881-
'count' => 2,
882-
'path' => __DIR__ . '/system/Config/BaseService.php',
883-
];
884874
$ignoreErrors[] = [
885875
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
886876
'count' => 3,

phpstan.neon.dist

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,3 @@ parameters:
3838
booleansInConditions: true
3939
disallowedConstructs: true
4040
matchingInheritedMethodNames: true
41-
ignoreErrors:
42-
- '#^Call to function config with Config\\.+\:\:class is discouraged\.$#'
43-
codeigniter:
44-
additionalConfigNamespaces:
45-
- CodeIgniter\Config\

system/CodeIgniter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CodeIgniter
5454
/**
5555
* The current version of CodeIgniter Framework
5656
*/
57-
public const CI_VERSION = '4.4.2';
57+
public const CI_VERSION = '4.4.3';
5858

5959
/**
6060
* App startup time.

system/Commands/Generators/ModelGenerator.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,8 @@ protected function prepare(string $class): string
101101
$baseClass = $match[1];
102102
}
103103

104-
$table = is_string($table) ? $table : plural(strtolower($baseClass));
105-
$dbGroup = is_string($dbGroup) ? $dbGroup : 'default';
106-
$return = is_string($return) ? $return : 'array';
104+
$table = is_string($table) ? $table : plural(strtolower($baseClass));
105+
$return = is_string($return) ? $return : 'array';
107106

108107
if (! in_array($return, ['array', 'object', 'entity'], true)) {
109108
// @codeCoverageIgnoreStart
@@ -129,6 +128,6 @@ protected function prepare(string $class): string
129128
$return = "'{$return}'";
130129
}
131130

132-
return $this->parseTemplate($class, ['{table}', '{dbGroup}', '{return}'], [$table, $dbGroup, $return]);
131+
return $this->parseTemplate($class, ['{dbGroup}', '{table}', '{return}'], [$dbGroup, $table, $return], compact('dbGroup'));
133132
}
134133
}

system/Commands/Generators/Views/model.tpl.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
class {class} extends Model
88
{
9+
<?php if (is_string($dbGroup)): ?>
910
protected $DBGroup = '{dbGroup}';
11+
<?php endif; ?>
1012
protected $table = '{table}';
1113
protected $primaryKey = 'id';
1214
protected $useAutoIncrement = true;

system/Common.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ function function_usable(string $functionName): bool
579579
if (! function_exists('helper')) {
580580
/**
581581
* Loads a helper file into memory. Supports namespaced helpers,
582-
* both in and out of the 'helpers' directory of a namespaced directory.
582+
* both in and out of the 'Helpers' directory of a namespaced directory.
583583
*
584584
* Will load ALL helpers of the matching name, in the following order:
585585
* 1. app/Helpers

0 commit comments

Comments
 (0)