Skip to content

Commit 8a74161

Browse files
authored
Merge pull request #7384 from codeigniter4/develop
4.3.3 Ready code
2 parents ba75eed + 25c7c21 commit 8a74161

File tree

91 files changed

+1039
-382
lines changed

Some content is hidden

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

91 files changed

+1039
-382
lines changed

CHANGELOG.md

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

3+
## [v4.3.3](https://github.com/codeigniter4/CodeIgniter4/tree/v4.3.3) (2023-03-26)
4+
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.3.2...v4.3.3)
5+
6+
### Fixed Bugs
7+
8+
* docs: fix $systemDirectory path in existing project. by @jozefrebjak in https://github.com/codeigniter4/CodeIgniter4/pull/7289
9+
* docs: fix message.rst and improve content_negotiation.rst by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7280
10+
* fix: Encryption CI3 compatibility by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7273
11+
* fix: [QueryBuilder] RawSql causes error when using like() and countAllResults() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7277
12+
* fix: handling of null bytes in `Exceptions::renderBacktrace()` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/7306
13+
* fix: incorrect metadata querying of Redis cache by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/7307
14+
* fix: [Email] add missing TLS 1.3 support by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7317
15+
* docs: add warning to random_string() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7333
16+
* fix: random_string() numeric by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7336
17+
* docs: add note for addColumn() and NULL by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7342
18+
* fix: respondNoContent() returns Kint script in development mode by @anggadarkprince in https://github.com/codeigniter4/CodeIgniter4/pull/7347
19+
* fix: use first exception in exceptionHandler() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7341
20+
* fix: random_string() alpha alnum nozero by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7344
21+
* fix: migrate:rollback -b negative number by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7350
22+
* fix: site_url() does not support protocol-relative links by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7353
23+
* docs: add uri_string() BC in v4.3.2 by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7356
24+
* fix: Cache FileHandler error when there is a folder in cache dir by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7361
25+
26+
### Refactoring
27+
28+
* refactor: consistent header name case by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7299
29+
330
## [v4.3.2](https://github.com/codeigniter4/CodeIgniter4/tree/v4.3.2) (2023-02-18)
431
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.3.1...v4.3.2)
532

633
### Breaking Changes
734

835
* fix: base_url() removes trailing slash in baseURL by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7200
36+
* fix: remove parameter $relative in `uri_string()` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7135
937

1038
### Fixed Bugs
1139

@@ -14,7 +42,6 @@
1442
* fix: remove `All` from `Options All -Indexes` in .htaccess by @sba in https://github.com/codeigniter4/CodeIgniter4/pull/7093
1543
* fix: bug on stuck content-type header in Feature Testing by @baycik in https://github.com/codeigniter4/CodeIgniter4/pull/7112
1644
* fix: ordering `Validation` show error by call `setRule()` by @ddevsr in https://github.com/codeigniter4/CodeIgniter4/pull/7149
17-
* fix: remove parameter $relative in `uri_string()` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7135
1845
* fix: [QueryBuilder] where() generates incorrect SQL when using RawSql by @sclubricants in https://github.com/codeigniter4/CodeIgniter4/pull/7147
1946
* fix: [QueryBuilder] RawSql passed to set() disappears without error by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7148
2047
* fix: [Parser] local_currency causes "Passing null to parameter" by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7157

admin/RELEASE.md

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ If you release a new minor version.
1616

1717
## Changelog
1818

19-
When generating the changelog each Pull Request to be included must have one of the following [labels](https://github.com/codeigniter4/CodeIgniter4/labels):
19+
When generating the changelog each Pull Request to be included must have one of
20+
the following [labels](https://github.com/codeigniter4/CodeIgniter4/labels):
2021
- **bug** ... PRs that fix bugs
2122
- **enhancement** ... PRs to improve existing functionalities
2223
- **new feature** ... PRs for new features
@@ -27,7 +28,8 @@ PRs with breaking changes must have the following additional label:
2728

2829
### Generate Changelog
2930

30-
To auto-generate, navigate to the [Releases](https://github.com/codeigniter4/CodeIgniter4/releases) page,
31+
To auto-generate, navigate to the
32+
[Releases](https://github.com/codeigniter4/CodeIgniter4/releases) page,
3133
click the "Draft a new release" button.
3234

3335
* Tag: "v4.x.x" (Create new tag)
@@ -39,32 +41,42 @@ Check the resulting content. If there are items in the *Others* section which
3941
should be included in the changelog, add a label to the PR and regenerate
4042
the changelog.
4143

42-
Copy the resulting content into **CHANGELOG.md** and adjust the format to match the existing content.
44+
Copy the resulting content into **CHANGELOG.md** and adjust the format to match
45+
the existing content.
4346

4447
## Preparation
4548

4649
* Work off direct clones of the repos so the release branches persist for a time
47-
* Clone both **codeigniter4/CodeIgniter4** and **codeigniter4/userguide** and resolve any necessary PRs
50+
* Clone both **codeigniter4/CodeIgniter4** and **codeigniter4/userguide** and
51+
resolve any necessary PRs
4852
```console
4953
git clone [email protected]:codeigniter4/CodeIgniter4.git
5054
git clone [email protected]:codeigniter4/userguide.git
5155
```
52-
* Vet the **admin/** folders for any removed hidden files (Action deploy scripts *do not remove these*)
56+
* Vet the **admin/** folders for any removed hidden files (Action deploy scripts
57+
*do not remove these*)
5358
* Merge any Security Advisory PRs in private forks
5459

5560
## Process
5661

57-
> Note: Most changes that need noting in the User Guide and docs should have been included
58-
> with their PR, so this process assumes you will not be generating much new content.
62+
> **Note** Most changes that need noting in the User Guide and docs should have
63+
> been included with their PR, so this process assumes you will not be
64+
> generating much new content.
5965
6066
* Create a new branch `release-4.x.x`
61-
* Update **system/CodeIgniter.php** with the new version number: `const CI_VERSION = '4.x.x';`
62-
* Update **user_guide_src/source/conf.py** with the new `version = '4.x'` (if applicable) and `release = '4.x.x'`
67+
* Update **system/CodeIgniter.php** with the new version number:
68+
`const CI_VERSION = '4.x.x';`
69+
* Update **user_guide_src/source/conf.py** with the new `version = '4.x'` (if applicable)
70+
and `release = '4.x.x'`
6371
* Replace **CHANGELOG.md** with the new version generated above
64-
* Set the date in **user_guide_src/source/changelogs/{version}.rst** to format `Release Date: January 31, 2021`
65-
* Create a new changelog for the next version at **user_guide_src/source/changelogs/{next_version}.rst** and add it to **index.rst**
66-
* Create **user_guide_src/source/installation/upgrade_{ver}.rst**, fill in the "All Changes" section, and add it to **upgrading.rst**
67-
* git diff --name-status master -- . ':!system'
72+
* Set the date in **user_guide_src/source/changelogs/{version}.rst** to format
73+
`Release Date: January 31, 2021`
74+
* Create a new changelog for the next version at
75+
**user_guide_src/source/changelogs/{next_version}.rst** and add it to
76+
**index.rst**
77+
* Create **user_guide_src/source/installation/upgrade_{ver}.rst**, fill in the
78+
"All Changes" section, and add it to **upgrading.rst**
79+
* git diff --name-status origin/master -- . ':!system'
6880
* Commit the changes with "Prep for 4.x.x release" and push to origin
6981
* Create a new PR from `release-4.x.x` to `develop`:
7082
* Title: "Prep for 4.x.x release"
@@ -85,9 +97,13 @@ See the changelog: https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHA
8597
8698
## New Contributors
8799
*
100+
101+
Full Changelog: https://github.com/codeigniter4/CodeIgniter4/compare/v4.x.x...v4.x.x
88102
```
89-
* Watch for the "Deploy Distributable Repos" action to make sure **framework**, **appstarter**, and **userguide** get updated
90-
* Run the following commands to install and test `appstarter` and verify the new version:
103+
* Watch for the "Deploy Distributable Repos" action to make sure **framework**,
104+
**appstarter**, and **userguide** get updated
105+
* Run the following commands to install and test `appstarter` and verify the new
106+
version:
91107
```console
92108
composer create-project codeigniter4/appstarter release-test
93109
cd release-test
@@ -121,22 +137,28 @@ git switch -c 4.x
121137
git push origin HEAD
122138
```
123139
* Publish any Security Advisories that were resolved from private forks
124-
* Announce the release on the forums and Slack channel (note: this forum is restricted to administrators):
125-
* Make a new topic in the "News & Discussion" forums: https://forum.codeigniter.com/forum-2.html
126-
* The content is somewhat organic, but should include any major features and changes as well as a link to the User Guide's changelog
140+
* Announce the release on the forums and Slack channel
141+
(note: this forum is restricted to administrators):
142+
* Make a new topic in the "News & Discussion" forums:
143+
https://forum.codeigniter.com/forum-2.html
144+
* The content is somewhat organic, but should include any major features and
145+
changes as well as a link to the User Guide's changelog
127146

128147
## After Publishing Security Advisory
129148

130149
* Send a PR to [PHP Security Advisories Database](https://github.com/FriendsOfPHP/security-advisories).
131150
* E.g. https://github.com/FriendsOfPHP/security-advisories/pull/606
132151
* See https://github.com/FriendsOfPHP/security-advisories#contributing
133-
* Don't forget to run `php -d memory_limit=-1 validator.php`, before submitting the PR
152+
* Don't forget to run `php -d memory_limit=-1 validator.php`, before
153+
submitting the PR
134154

135155
## Appendix
136156

137157
### Sphinx Installation
138158

139-
You may need to install Sphinx and its dependencies prior to building the User Guide.
159+
You may need to install Sphinx and its dependencies prior to building the User
160+
Guide.
161+
140162
This worked seamlessly on Ubuntu 20.04:
141163
```console
142164
sudo apt install python3-sphinx
@@ -152,8 +174,10 @@ sudo pip3 install sphinx_rtd_theme
152174
* Build the ePub version of the User Guide: `make epub`
153175
* Switch to the **userguide** repo and create a new branch `release-4.x.x`
154176
* Replace **docs/** with **CodeIgniter4/user_guide_src/build/html**
155-
* Ensure the file **docs/.nojekyll** exists or GitHub Pages will ignore folders with an underscore prefix
156-
* Copy **CodeIgniter4/user_guide_src/build/epub/CodeIgniter.epub** to **./CodeIgniter4.x.x.epub**
177+
* Ensure the file **docs/.nojekyll** exists or GitHub Pages will ignore folders
178+
with an underscore prefix
179+
* Copy **CodeIgniter4/user_guide_src/build/epub/CodeIgniter.epub** to
180+
**./CodeIgniter4.x.x.epub**
157181
* Commit the changes with "Update for 4.x.x" and push to origin
158182
* Create a new PR from `release-4.x.x` to `develop`:
159183
* Title: "Update for 4.x.x"
@@ -165,6 +189,6 @@ sudo pip3 install sphinx_rtd_theme
165189
* Description: "CodeIgniter 4.x.x User Guide"
166190
* Watch for the "github pages" Environment to make sure the deployment succeeds
167191

168-
The User Guide website should update itself via the deploy GitHub Action. Should this fail
169-
the server must be updated manually. See repo and hosting details in the deploy script
170-
at the User Guide repo.
192+
The User Guide website should update itself via the deploy GitHub Action. Should
193+
this fail the server must be updated manually. See repo and hosting details in
194+
the deploy script at the User Guide repo.

admin/framework/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"psr/log": "^1.1"
1414
},
1515
"require-dev": {
16-
"kint-php/kint": "^5.0.3",
16+
"kint-php/kint": "^5.0.4",
1717
"codeigniter/coding-standard": "^1.5",
1818
"fakerphp/faker": "^1.9",
1919
"friendsofphp/php-cs-fixer": "3.13.0",

app/Common.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
* loaded early on, and may also contain additional functions
1212
* that you'd like to use throughout your entire application
1313
*
14-
* @see: https://codeigniter4.github.io/CodeIgniter4/
14+
* @see: https://codeigniter.com/user_guide/extending/common.html
1515
*/

app/Config/Encryption.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,13 @@ class Encryption extends BaseConfig
8080
* Set to 'authentication' for CI3 Encryption compatibility.
8181
*/
8282
public string $authKeyInfo = '';
83+
84+
/**
85+
* Cipher to use.
86+
* This setting is only used by OpenSSLHandler.
87+
*
88+
* Set to 'AES-128-CBC' to decrypt encrypted data that encrypted
89+
* by CI3 Encryption default configuration.
90+
*/
91+
public string $cipher = 'AES-256-CTR';
8392
}

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
"psr/log": "^1.1"
1414
},
1515
"require-dev": {
16-
"kint-php/kint": "^5.0.3",
16+
"kint-php/kint": "^5.0.4",
1717
"codeigniter/coding-standard": "^1.5",
1818
"fakerphp/faker": "^1.9",
19-
"friendsofphp/php-cs-fixer": "3.13.0",
2019
"mikey179/vfsstream": "^1.6",
2120
"nexusphp/cs-config": "^3.6",
2221
"nexusphp/tachycardia": "^1.0",
@@ -25,7 +24,7 @@
2524
"phpunit/phpcov": "^8.2",
2625
"phpunit/phpunit": "^9.1",
2726
"predis/predis": "^1.1 || ^2.0",
28-
"rector/rector": "0.15.16",
27+
"rector/rector": "0.15.23",
2928
"vimeo/psalm": "^5.0"
3029
},
3130
"suggest": {

phpstan-baseline.neon.dist

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ parameters:
2020
count: 1
2121
path: system/Cache/Handlers/FileHandler.php
2222

23-
-
24-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
25-
count: 1
26-
path: system/Cache/Handlers/MemcachedHandler.php
27-
2823
-
2924
message: "#^Property CodeIgniter\\\\Cache\\\\Handlers\\\\RedisHandler\\:\\:\\$redis \\(Redis\\) in isset\\(\\) is not nullable\\.$#"
3025
count: 1
@@ -50,16 +45,6 @@ parameters:
5045
count: 1
5146
path: system/Database/BaseConnection.php
5247

53-
-
54-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
55-
count: 2
56-
path: system/Database/BaseResult.php
57-
58-
-
59-
message: "#^While loop condition is always true\\.$#"
60-
count: 2
61-
path: system/Database/BaseResult.php
62-
6348
-
6449
message: "#^Access to an undefined property CodeIgniter\\\\Database\\\\ConnectionInterface\\:\\:\\$DBDriver\\.$#"
6550
count: 2
@@ -260,21 +245,11 @@ parameters:
260245
count: 1
261246
path: system/Router/Router.php
262247

263-
-
264-
message: "#^Strict comparison using \\=\\=\\= between string and true will always evaluate to false\\.$#"
265-
count: 1
266-
path: system/Session/Handlers/RedisHandler.php
267-
268248
-
269249
message: "#^Property CodeIgniter\\\\Session\\\\Session\\:\\:\\$sessionExpiration \\(int\\) in isset\\(\\) is not nullable\\.$#"
270250
count: 1
271251
path: system/Session/Session.php
272252

273-
-
274-
message: "#^Negated boolean expression is always false\\.$#"
275-
count: 1
276-
path: system/Test/CIUnitTestCase.php
277-
278253
-
279254
message: "#^Access to an undefined property object\\:\\:\\$createdField\\.$#"
280255
count: 1

rector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
__DIR__ . '/system/Debug/Toolbar/Views/toolbar.tpl.php',
7979
__DIR__ . '/system/ThirdParty',
8080
__DIR__ . '/tests/system/Config/fixtures',
81+
__DIR__ . '/tests/system/Filters/fixtures',
8182
__DIR__ . '/tests/_support',
8283
JsonThrowOnErrorRector::class,
8384
StringifyStrNeedlesRector::class,

system/API/ResponseTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ protected function respond($data = null, ?int $status = null, string $message =
9292
if ($data === null && $status === null) {
9393
$status = 404;
9494
$output = null;
95+
$this->format($data);
9596
} elseif ($data === null && is_numeric($status)) {
9697
$output = null;
98+
$this->format($data);
9799
} else {
98100
$status = empty($status) ? 200 : $status;
99101
$output = $this->format($data);

system/Cache/Handlers/FileHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ protected function getDirFileInfo(string $sourceDir, bool $topLevelOnly = true,
346346
while (false !== ($file = readdir($fp))) {
347347
if (is_dir($sourceDir . $file) && $file[0] !== '.' && $topLevelOnly === false) {
348348
$this->getDirFileInfo($sourceDir . $file . DIRECTORY_SEPARATOR, $topLevelOnly, true);
349-
} elseif ($file[0] !== '.') {
349+
} elseif (! is_dir($sourceDir . $file) && $file[0] !== '.') {
350350
$_filedata[$file] = $this->getFileInfo($sourceDir . $file);
351351
$_filedata[$file]['relative_path'] = $relativePath;
352352
}

system/Cache/Handlers/RedisHandler.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,11 @@ public function getCacheInfo()
233233
*/
234234
public function getMetaData(string $key)
235235
{
236-
$key = static::validateKey($key, $this->prefix);
237236
$value = $this->get($key);
238237

239238
if ($value !== null) {
240239
$time = Time::now()->getTimestamp();
241-
$ttl = $this->redis->ttl($key);
240+
$ttl = $this->redis->ttl(static::validateKey($key, $this->prefix));
242241

243242
return [
244243
'expire' => $ttl > 0 ? $time + $ttl : null,

system/CodeIgniter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class CodeIgniter
4747
/**
4848
* The current version of CodeIgniter Framework
4949
*/
50-
public const CI_VERSION = '4.3.2';
50+
public const CI_VERSION = '4.3.3';
5151

5252
/**
5353
* App startup time.

system/Commands/Database/MigrateRollback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class MigrateRollback extends BaseCommand
5757
* @var array
5858
*/
5959
protected $options = [
60-
'-b' => 'Specify a batch to roll back to; e.g. "3" to return to batch #3 or "-2" to roll back twice',
60+
'-b' => 'Specify a batch to roll back to; e.g. "3" to return to batch #3',
6161
'-g' => 'Set database group',
6262
'-f' => 'Force command - this option allows you to bypass the confirmation question when running this command in a production environment',
6363
];

system/Commands/Utilities/Routes/ControllerFinder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public function find(): array
4444
$nsArray = explode('\\', trim($this->namespace, '\\'));
4545
$count = count($nsArray);
4646
$ns = '';
47+
$files = [];
4748

4849
for ($i = 0; $i < $count; $i++) {
4950
$ns .= '\\' . array_shift($nsArray);

system/Database/BaseBuilder.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,9 +2021,9 @@ private function setAlias(string $alias): BaseBuilder
20212021
/**
20222022
* Sets update fields for upsert, update
20232023
*
2024-
* @param string|string[] $set
2025-
* @param bool $addToDefault adds update fields to the default ones
2026-
* @param array|null $ignore ignores items in set
2024+
* @param RawSql[]|string|string[] $set
2025+
* @param bool $addToDefault adds update fields to the default ones
2026+
* @param array|null $ignore ignores items in set
20272027
*
20282028
* @return $this
20292029
*/
@@ -3082,6 +3082,10 @@ protected function compileWhereHaving(string $qbKey): string
30823082
continue;
30833083
}
30843084

3085+
if ($qbkey instanceof RawSql) {
3086+
continue;
3087+
}
3088+
30853089
if ($qbkey['condition'] instanceof RawSql) {
30863090
$qbkey = $qbkey['condition'];
30873091

0 commit comments

Comments
 (0)