Skip to content
Edit this page

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 of Config\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.invalidFileName language string.

Changes

  • Session: Added defensive escaping of session lock arguments in PostgreHandler, preserving the existing locking behavior.

Deprecations

  • Filters: CodeIgniter\Filters\Filters::$modules and the $modules constructor 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 filters entry in Config\Modules::$aliases is 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() and PredisHandler::decrement() updated the unused 'data' hash field instead of '__ci_value', causing get() to return stale values for existing counters.
  • CORS: Fixed a bug where Cors::hasResponseHeaders() matched header substrings via str_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, and SQLSRV Forge::_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 $table unescaped into Object_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 in PRAGMA 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 in DROP 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 a TypeError when $phrase was not found in $text or when $phrase was null and $radius was an odd integer. When $phrase is not found, excerpt() now falls back to extracting an excerpt from the beginning of $text.
  • Helpers: Fixed a bug where format_number() with $precision = 0 appended 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 for matrix, vertex, and index lacked non-capturing grouping and an end-of-string anchor for the ix alternative, causing incorrect pluralization of words like complex, sex, and strings containing matrix before the end. Expanded plural() and singular() to support additional words ending in ix or ex (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 a TypeError, 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() and UploadedFile::store() on Windows could store a file under a different name than getName() 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 an ImagickException instead of falling back to the image's format.
  • Pager: Fixed a bug where Pager::makeLinks() threw a TypeError when $group was null.
  • Router: Fixed a bug where Router::replaceBackReferences() failed to match and replace multi-digit back-references (such as $10 or higher) when Routing::$multipleSegmentsOneParam was 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 a TypeError when 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 without src are stripped.
  • Session: Fixed a bug where BaseHandler::destroyCookie() did not send the SameSite attribute in the Set-Cookie header, which could prevent browsers from properly clearing the session cookie.
  • Session: Fixed a bug where MemcachedHandler did not reset lock state in close() or release an existing lock for a different session ID in lockSession(), 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 from Request's cached cookie global if cookies had already been read from Request.
  • Worker Mode: Fixed a bug where every request that ended with an uncaught exception, including a 404 Page Not Found without a 404 override, called exit() 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.