Skip to content

Commit 4c833be

Browse files
authored
Merge pull request #9642 from codeigniter4/develop
4.6.2 Ready code
2 parents 8520691 + 14719d8 commit 4c833be

File tree

247 files changed

+3190
-3521
lines changed

Some content is hidden

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

247 files changed

+3190
-3521
lines changed

.github/workflows/test-coding-standards.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,3 @@ jobs:
6565

6666
- name: Run lint
6767
run: composer cs
68-
env:
69-
PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.php-version == '8.4' }}

.github/workflows/test-psalm.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,7 @@ jobs:
6666
restore-keys: ${{ runner.os }}-psalm-
6767

6868
- name: Install dependencies
69-
run: |
70-
if [ -f composer.lock ]; then
71-
composer install --no-progress
72-
else
73-
composer update --no-progress
74-
fi
69+
run: composer update --ansi --no-interaction
7570

7671
- name: Run Psalm analysis
7772
run: utils/vendor/bin/psalm

.php-cs-fixer.dist.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
use CodeIgniter\CodingStandard\CodeIgniter4;
1515
use Nexus\CsConfig\Factory;
16-
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
17-
use Nexus\CsConfig\FixerGenerator;
1816
use PhpCsFixer\Finder;
1917

2018
$finder = Finder::create()
@@ -44,12 +42,8 @@
4442
];
4543

4644
$options = [
47-
'cacheFile' => 'build/.php-cs-fixer.cache',
48-
'finder' => $finder,
49-
'customFixers' => FixerGenerator::create('utils/vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
50-
'customRules' => [
51-
NoCodeSeparatorCommentFixer::name() => true,
52-
],
45+
'cacheFile' => 'build/.php-cs-fixer.cache',
46+
'finder' => $finder,
5347
];
5448

5549
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(

.php-cs-fixer.tests.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
->notName('#Foobar.php$#');
3232

3333
$overrides = [
34-
'void_return' => true,
34+
'phpdoc_to_return_type' => true,
35+
'void_return' => true,
3536
];
3637

3738
return $config

CHANGELOG.md

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

3-
## [v4.6.1](https://github.com/codeigniter4/CodeIgniter4/tree/v4.6.0) (2025-05-02)
3+
## [v4.6.2](https://github.com/codeigniter4/CodeIgniter4/tree/v4.6.2) (2025-07-26)
4+
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.6.1...v4.6.2)
5+
6+
### Security
7+
8+
* **ImageMagickHandler**: *Command Injection Vulnerability in ImageMagick Handler*
9+
Fixes a vulnerability relating to uses of `ImageMagickHandler`'s `resize()` or `text()` methods
10+
where an attacker can upload malicious filenames containing shell metacharacters that get executed when
11+
the image is processed or when text is added to the image.
12+
13+
See the [security advisory](https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-9952-gv64-x94c)
14+
for details. Credits to @vicevirus for reporting the issue.
15+
16+
### Fixed Bugs
17+
18+
* chore: add missing EscaperInterface to the AutoloadConfig by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9561
19+
* fix: remove service dependency from sanitize_filename() helper function by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9560
20+
* fix: use native PHP truthiness for condition evaluation in when()/whenNot() by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9576
21+
* fix: add error handling for corrupted cache files in `FileHandler` by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9586
22+
* fix: correct `getHostname()` fallback logic in `Email` class by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9587
23+
* fix: encapsulation violation in `BasePreparedQuery` class by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9603
24+
* fix: URI authority generation for schemes without default ports by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9605
25+
* fix: correct path parsing in `SiteURIFactory::parseRequestURI()` by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9613
26+
* fix: support for multibyte folder names when the app is served from a subfolder by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9615
27+
* fix: use correct 24-hour time format in development error page. by @ping-yee in https://github.com/codeigniter4/CodeIgniter4/pull/9628
28+
* fix: improve CURLRequest intermediate HTTP response handling by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9627
29+
* fix: ensure `make:test` works on Windows by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9635
30+
* fix: ensure `make:test` generates test files ending in `Test` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9636
31+
* fix: `make:test` requires 3 inputs after entering an empty class name by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9637
32+
* fix: add filename parameters to inline Content-Disposition headers by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9638
33+
34+
### Refactoring
35+
36+
* refactor: add `system/util_bootstrap.php` to curb overreliance to `system/Test/bootstrap.php` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9562
37+
* refactor: update places to use `system/util_bootstrap.php` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9568
38+
* refactor: more accurate array PHPDocs of Cookie by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9569
39+
* refactor: use native phpdocs wherever possible by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9571
40+
* refactor: fix `notIdentical.alwaysTrue` error by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9579
41+
* refactor: fix phpstan errors in `Events` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9580
42+
* refactor: fix non-booleans in if conditions by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9578
43+
* refactor: fix and micro-optimize code in `Format` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9583
44+
* refactor: fix various phpstan errors in Log component by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9581
45+
* refactor: partial fix errors on Email by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9582
46+
* refactor: fix phpstan errors in `ResponseTrait` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9591
47+
* refactor: precise PHPDocs for Autoloader by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9593
48+
* refactor: fix phpstan errors in mock classes by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9594
49+
* refactor: fix various phpstan errors in Cache by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9610
50+
* fix: apply rector rule TernaryImplodeToImplodeRector by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9614
51+
* refactor: `Console::showHeader()` call `date()` only once by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9616
52+
53+
## [v4.6.1](https://github.com/codeigniter4/CodeIgniter4/tree/v4.6.1) (2025-05-02)
454
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.6.0...v4.6.1)
555

656
### Fixed Bugs
57+
758
* fix(CURLRequest): multiple header sections after redirects by @ducng99 in https://github.com/codeigniter4/CodeIgniter4/pull/9426
859
* fix: set headers for CORS by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9437
960
* fix: upsert with composite unique index by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9454
@@ -13,6 +64,7 @@
1364
* fix: added "application/octet-stream" to the "stl" mime type in the M… by @Franky5831 in https://github.com/codeigniter4/CodeIgniter4/pull/9543
1465

1566
### Refactoring
67+
1668
* refactor: get upper first protocol only one call in Email by @ddevsr in https://github.com/codeigniter4/CodeIgniter4/pull/9449
1769
* refactor: PHPDocs in `env()` by @ddevsr in https://github.com/codeigniter4/CodeIgniter4/pull/9468
1870
* refactor: remove lowercase event name for logging by @ddevsr in https://github.com/codeigniter4/CodeIgniter4/pull/9483

admin/framework/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ writable/uploads/*
6161
!writable/uploads/index.html
6262

6363
writable/debugbar/*
64-
!writable/debugbar/.gitkeep
64+
!writable/debugbar/index.html
6565

6666
php_errors.log
6767

admin/framework/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"php": "^8.1",
1414
"ext-intl": "*",
1515
"ext-mbstring": "*",
16-
"laminas/laminas-escaper": "^2.14",
16+
"laminas/laminas-escaper": "^2.17",
1717
"psr/log": "^3.0"
1818
},
1919
"require-dev": {
@@ -24,7 +24,7 @@
2424
"mikey179/vfsstream": "^1.6.12",
2525
"nexusphp/cs-config": "^3.6",
2626
"phpunit/phpunit": "^10.5.16 || ^11.2",
27-
"predis/predis": "^1.1 || ^2.3"
27+
"predis/predis": "^3.0"
2828
},
2929
"suggest": {
3030
"ext-curl": "If you use CURLRequest class",

admin/starter/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ writable/uploads/*
6161
!writable/uploads/index.html
6262

6363
writable/debugbar/*
64-
!writable/debugbar/.gitkeep
64+
!writable/debugbar/index.html
6565

6666
php_errors.log
6767

app/Config/Cache.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class Cache extends BaseConfig
7878
* Your file storage preferences can be specified below, if you are using
7979
* the File driver.
8080
*
81-
* @var array<string, int|string|null>
81+
* @var array{storePath?: string, mode?: int}
8282
*/
8383
public array $file = [
8484
'storePath' => WRITEPATH . 'cache/',
@@ -95,7 +95,7 @@ class Cache extends BaseConfig
9595
*
9696
* @see https://codeigniter.com/user_guide/libraries/caching.html#memcached
9797
*
98-
* @var array<string, bool|int|string>
98+
* @var array{host?: string, port?: int, weight?: int, raw?: bool}
9999
*/
100100
public array $memcached = [
101101
'host' => '127.0.0.1',
@@ -112,7 +112,7 @@ class Cache extends BaseConfig
112112
* Your Redis server can be specified below, if you are using
113113
* the Redis or Predis drivers.
114114
*
115-
* @var array<string, int|string|null>
115+
* @var array{host?: string, password?: string|null, port?: int, timeout?: int, database?: int}
116116
*/
117117
public array $redis = [
118118
'host' => '127.0.0.1',

app/Config/Cookie.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class Cookie extends BaseConfig
8585
* (empty string) means default SameSite attribute set by browsers (`Lax`)
8686
* will be set on cookies. If set to `None`, `$secure` must also be set.
8787
*
88-
* @phpstan-var 'None'|'Lax'|'Strict'|''
88+
* @var ''|'Lax'|'None'|'Strict'
8989
*/
9090
public string $samesite = 'Lax';
9191

0 commit comments

Comments
 (0)