Version 4.6.2

Release Date: Unreleased

4.6.2 release of CodeIgniter4

BREAKING

Message Changes

Changes

  • Security: The sanitize_filename() function from the Security helper now supports a second parameter to control whether relative paths are allowed.

Deprecations

  • Security: The Security::sanitizeFilename() method is deprecated. Use sanitize_filename() instead.

  • Security: The SecurityInterface::sanitizeFilename() method is deprecated.

Bugs Fixed

  • Database: Fixed a bug where when() and whenNot() in ConditionalTrait incorrectly evaluated certain falsy values (such as [], 0, 0.0, and '0') as truthy, causing callbacks to be executed unexpectedly. These methods now cast the condition to a boolean using (bool) to ensure consistent behavior with PHP’s native truthiness.

  • Security: Fixed a bug where the sanitize_filename() function from the Security helper would throw an error when used in CLI requests.

  • Session: Fixed a bug where using the DatabaseHandler with an unsupported database driver (such as SQLSRV, OCI8, or SQLite3) did not throw an appropriate error.

See the repo’s CHANGELOG.md for a complete list of bugs fixed.