user_guide_src/source/changelogs/v4.6.2.rst
############# Version 4.6.2 #############
Release Date: July 26, 2025
4.6.2 release of CodeIgniter4
.. contents:: :local: :depth: 3
SECURITY
Security advisory GHSA-9952-gv64-x94c <https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-9952-gv64-x94c>_
for more information.Changes
sanitize_filename() function from the Security helper now supports a second parameter to control whether relative paths are allowed.Deprecations
Security::sanitizeFilename() method is deprecated. Use sanitize_filename() instead.SecurityInterface::sanitizeFilename() method is deprecated.Bugs Fixed
FileHandler::getItem().make:test where it would always error on Windows.make:test where the generated test file would not end with Test.php.make:test where input prompt would display for three times after not entering a class name.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.BasePreparedQuery when accessing BaseConnection::transStatus protected property.filename parameters were missing from Content-Disposition headers when using inline disposition, causing browsers to use the last URL segment for filenames instead of the intended filename.Email::getHostname() failed to use $_SERVER['SERVER_ADDR'] when $_SERVER['SERVER_NAME'] was not set.sanitize_filename() function from the Security helper would throw an error when used in CLI requests.DatabaseHandler with an unsupported database driver (such as SQLSRV, OCI8, or SQLite3) did not throw an appropriate error.SiteURIFactory::parseRequestURI() where serving the app from a subfolder using mod_rewrite while preserving the index.php file would cause incorrect route path detection.SiteURIFactory::parseRequestURI() where folder names containing multibyte (non-ASCII) characters were not correctly resolved when the application was served from a subfolder.URI::getAuthority() where schemes without defined default ports (like rtsp://) would cause issues due to missing array key handling.See the repo's
CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>_
for a complete list of bugs fixed.