Skip to content

5.x update changelog - #438

Open
papac wants to merge 39 commits into
mainfrom
5.x-update-changelog
Open

papac wants to merge 39 commits into
mainfrom
5.x-update-changelog

Conversation

@papac

@papac papac commented Nov 10, 2026

Copy link
Copy Markdown
Member

No description provided.

papac and others added 30 commits June 15, 2026 02:14
- file() — the broken !is_uploaded_file(...) === UPLOAD_ERR_OK check (always false due to precedence) now correctly rejects non-uploaded files while preserving the array/multi-file path.
- locale() — the delimiter-less regex ('^([a-z]+)[-_]?/i') that warned and never matched is now '/([a-z]+)[-_]?/i', with null guards for a missing header.
- query() / post() — return type was array but returned scalars (guaranteed TypeError); now mixed with a $default argument matching get()'s contract.
- time() — read the non-existent $_SESSION['REQUEST_TIME']; now returns an int from $_SERVER['REQUEST_TIME'].
- old() — $fallback had no default, fataling on old('x'); now defaults to null (also fixed the fullback typo).
- hostname() / path() — guarded against undefined $_SERVER indices (CLI/tests) and fixed strpos truthiness with !== false.

Methods added:

isMethod(string) — match the request method.
input(key, default) — alias of get().
boolean(key, default) — coerce an input to bool (1/true/on/yes).
bearerToken() — extract the token from an Authorization: Bearer … header.
Many Bugs fixed and new methods
fix(queue): add beanstalkd type error
fix(queue): add beanstalkd type error
fix(queue): Return value must be of type Bow\Queue\QueueTask, __PHP_Incomplete_Class returned
- Database\QueryBuilder: bind whereBetween/whereNotBetween range values
  (SQL injection) and validate column/table identifiers in where*, join,
  select, aggregate, distinct, increment and insert/update keys through
  assertSafeIdentifier (wildcards allowed only where legitimate).
- Storage\DiskFilesystemService::path(): confine resolved paths to the base
  directory and reject traversal (arbitrary read/write/delete).
- Mail\Envelop: strip CR/LF/NUL from header-bound values (header/SMTP
  injection, CWE-93).
- Middleware\CsrfMiddleware: reject empty tokens and compare with hash_equals
  (null==null bypass and timing).
- Auth\SessionGuard + Session::regenerate(): rotate the session id on login
  while preserving data (session fixation).
- Security\Crypto::decrypt(): fail closed on non-authenticated legacy
  (static-IV) input unless explicitly opted in via allowLegacy().
- Http: sanitize download filename; basename() the explicit upload target.

Adds regression tests for the above.
Security hardening across query builder, storage, auth, mail and crypto
A JSON body is decoded with native types, so a field declared
`nullable|boolean` received a real false and the nullable rule passed it
to the string-typed Str::isEmpty(), throwing a TypeError (HTTP 500) before
the boolean rule ever ran. The same assumption broke nullable with ints,
floats and arrays, max/min/size with numbers and booleans, and alpha,
alphanum, lower, upper and email with any non-string.

- NullableRule: a value is absent only when null, a blank string or an
  empty array; false, 0 and 0.0 are real values and reach the next rules.
- StringRule: max, min and size compare native numbers by value and
  strings by length, following the convention documented by between.
  Numeric strings keep length semantics so form inputs are unchanged.
  Booleans and arrays fail the rule instead of throwing.
- alpha, alphanum, lower, upper and email fail cleanly on non-strings.

Adds a database-free regression test class covering each case and a full
JSON payload.
whereIn() with an empty array built `column in ()`, invalid SQL (SQLSTATE
42601) that `php bow migrate` hit on a project with no migrations yet. An
empty list now compiles to `in (null)`, valid everywhere and matching no
row.

PostgreSQLAdapter honours a per-connection `emulate_prepares` config key
(default false). Behind a pooler a server-side prepared statement can
outlive a schema change and fail with SQLSTATE 0A000 "cached plan must not
change result type"; with emulated prepares PDO quotes the values itself
and nothing is cached on the server.

Both were previously re-applied as vendor patches by an application;
regression tests added for each.
getTrace() returns frames with their arguments, and serializing those can
run code: an argument object whose jsonSerialize() issues a query throws
again when the transaction is already aborted, so the logger itself failed
while reporting the original error.

- LoggerConfiguration and QueueAdapter log the exception class, file:line
  and getTraceAsString() as context instead of the frame array.
- BaseErrorHandler puts getTraceAsString() in the non-production JSON
  response instead of the frame array.
Validator JSON types, empty whereIn, pgsql emulate_prepares, string traces
papac and others added 9 commits October 13, 2026 09:19
Every test job has failed at "docker compose up" since late September:
MinIO removed minio/minio and minio/mc from Docker Hub (the registry now
answers "object not found") and quay.io requires a login, so the pull of
the minio-init container aborted the whole stack and PHPUnit never ran.

- docker-compose: the minio service now uses bitnamilegacy/minio, which
  serves the same API on the same ports and creates the public "tests"
  bucket itself through MINIO_DEFAULT_BUCKETS. The minio-init service and
  its mc image are gone; the healthcheck polls /minio/health/ready.
- tests workflow: the wait step polls the bucket over HTTP instead of
  waiting for the removed init container.

Verified locally: the S3 test suite passes against the new service, and
the other compose images still resolve on Docker Hub.
CI: replace the removed MinIO images so docker compose starts again
Capsule::resolve() returned the key itself when the class was not
instantiable, so make() on an interface or abstract class with no binding
handed back the type's *name* as a string. Callers expecting an instance
broke far from the cause, most visibly as "Compass::getInjectParameter():
Return value must be of type ?object, string returned" when a controller
constructor depended on an interface nobody had bound.

resolve() now throws ContainerException::notInstantiable(), whose message
names the type, says whether it is an interface or an abstract class, and
shows the bind() call to add. Covers make(), makeWith() and dependencies
resolved while building another class.
Container: fail clearly on an unbound interface or abstract class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant