Version 4.7.7¶
Release Date: Unreleased
4.7.7 release of CodeIgniter4
BREAKING¶
- Cache:
FileHandler::validateKey()now rejects/,\and null bytes in the cache item file name, independently ofConfig\Cache::$reservedCharacters, so a cache key can no longer point outside the cache directory when that setting is relaxed. See File Cache Rejects Directory Separators for migration instructions.
Message Changes¶
- Added the
HTTP.invalidFileNamelanguage string.
Changes¶
- Session: Added defensive escaping of session lock arguments in
PostgreHandler, preserving the existing locking behavior.
Deprecations¶
- Filters:
CodeIgniter\Filters\Filters::$modulesand the$modulesconstructor parameter are now marked as deprecated since v4.4.2, to complete the deprecation of the auto-discovery of Filters. Only that feature uses them. - Modules: The
filtersentry inConfig\Modules::$aliasesis likewise part of the Filters auto-discovery deprecated since v4.4.2, and is not needed once it is removed.
Bugs Fixed¶
- API: Fixed HTTP 500 errors in
ResponseTrait::paginate()when using a Query Builder with a very large page number or$perPage = 0. - Cache: Fixed a bug where
PredisHandler::increment()andPredisHandler::decrement()updated the unused'data'hash field instead of'__ci_value', causingget()to return stale values for existing counters. - CORS: Fixed a bug where
Cors::hasResponseHeaders()matched header substrings viastr_contains(), causing false positives when existing exposed headers shared a prefix with configured exposed headers. - Database: Fixed a bug where
BaseConnection::prepare()did not reset pretend mode when the closure threw an exception, leaving the connection in pretend mode so that subsequent queries on it were silently discarded. - Database: Fixed a bug where
Postgre,OCI8, andSQLSRVForge::_dropKeyAsConstraint()interpolated table, constraint, and schema names without escaping. - Database: Fixed a bug where
Postgre\Connection::insertID()interpolated table, column, and sequence names without escaping. - Database: Fixed a bug where
SQLSRV\Builder::_upsertBatch()concatenated$tableunescaped intoObject_ID(), causing syntax errors for table names with quotes or special characters. - Database: Fixed a bug where
SQLSRV\Forge::_alterTable()interpolated table and column names without escaping in default constraint lookups. - Database: Fixed a bug where
SQLite3\Connection::_foreignKeyData()did not escape table identifiers inPRAGMA foreign_key_list, causing syntax errors on table names containing hyphens or schemas. - Database: Fixed a bug where
SQLite3\Table::dropIndexes()used single-quoted string literals instead of escaped identifiers inDROP INDEX IF EXISTS, causing syntax errors on index names containing quotes or special characters. - Debug Toolbar: Fixed a bug where
History::setFiles()emitted a PHP warning when attempting to delete a debugbar history file that had already been removed. - Helpers: Fixed a bug where
excerpt()threw aTypeErrorwhen$phrasewas not found in$textor when$phrasewasnulland$radiuswas an odd integer. When$phraseis not found,excerpt()now falls back to extracting an excerpt from the beginning of$text. - Helpers: Fixed a bug where
format_number()with$precision = 0appended a trailing comma in locales using a comma as the decimal separator. - Helpers: Fixed a bug where
parse_subdomain()incorrectly treated hostnames with ports (such as IP addresses and two-part TLD domains) as having unexpected subdomains. - Helpers: Fixed a bug in
plural()where the regex formatrix,vertex, andindexlacked non-capturing grouping and an end-of-string anchor for theixalternative, causing incorrect pluralization of words likecomplex,sex, and strings containingmatrixbefore the end. Expandedplural()andsingular()to support additional words ending inixorex(apex,appendix,codex,cortex,latex,murex,vortex). - Helpers: Fixed bugs in
ArrayHelper::dotKeyExists()where'0'path segments caused early loop termination, non-array intermediate values threw aTypeError, and paths with segments after a wildcard failed when the wildcard matched multiple elements. - Helpers: Fixed escaping of attribute values in HTML media helpers to prevent malformed HTML and attribute injection.
- HTTP: Fixed a bug where query-string based routing truncated additional query parameters in
SiteURIFactory::parseRequestURI()due to incorrect array index access. - HTTP: Fixed a bug where
UploadedFile::move()andUploadedFile::store()on Windows could store a file under a different name thangetName()reported, or write its contents to an NTFS alternate data stream. Filenames ending in a period or space or containing a colon are now rejected, including explicitly supplied names. - Images: Fixed a bug in
ImageMagickHandler::save()where saving without an extension or with an unsupported extension threw anImagickExceptioninstead of falling back to the image's format. - Pager: Fixed a bug where
Pager::makeLinks()threw aTypeErrorwhen$groupwasnull. - Router: Fixed a bug where
Router::replaceBackReferences()failed to match and replace multi-digit back-references (such as$10or higher) whenRouting::$multipleSegmentsOneParamwas enabled. - Routing: Fixed a bug where redirect routes containing the
{locale}placeholder were not recognized as redirects and did not replace{locale}in the redirect target. - Security: Fixed a bug where
Security::__construct()threw aTypeErrorwhen the CSRF cookie was an array, causing an HTTP 500 response for affected requests. - Security: Fixed a bug in
strip_image_tags()where an invalid PCRE character class caused attribute injection and improper quote handling, and ensured tags withoutsrcare stripped. - Session: Fixed a bug where
BaseHandler::destroyCookie()did not send theSameSiteattribute in theSet-Cookieheader, which could prevent browsers from properly clearing the session cookie. - Session: Fixed a bug where
MemcachedHandlerdid not reset lock state inclose()or release an existing lock for a different session ID inlockSession(), causing subsequent reads and session ID regeneration on the same handler instance to fail. - Session: Fixed a bug where
Session::start()did not remove an invalid session cookie fromRequest's cached cookie global if cookies had already been read fromRequest. - Worker Mode: Fixed a bug where every request that ended with an uncaught exception, including a
404 Page Not Foundwithout a 404 override, calledexit()in the exception handler. This ended the worker script, so FrankenPHP booted a new one, and the worker loop skipped its cleanup after the request. The exception handler now returns to the worker loop.
See the repo's CHANGELOG.md for a complete list of bugs fixed.