From 9d7e8fded98562e31b7238ca7c5da5e7d6449c5f Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sat, 11 Jul 2026 01:11:56 +0100 Subject: [PATCH] Document the ASCII case folding requirement --- AGENTS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 8ce3ee5..620a8f8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,6 +26,10 @@ where they are accepted and we need to cast to a string, we should branch on `\is_finite($value)`, using `(string) $value` for the finite case and `\is_nan($value) ? 'NAN' : ($value > 0 ? 'INF' : '-INF')` otherwise. +- Never call `strtolower()`, `strtoupper()`, `strcasecmp()`, `stripos()`, or + other locale-sensitive case functions; use the locale-independent + `GuzzleHttp\Psr7\Utils::asciiToLower()`, `asciiToUpper()`, + `caselessEquals()`, and `caselessContains()` helpers instead. - Changes in behavior need a `CHANGELOG.md` entry in the unreleased section of the target branch and an `UPGRADING.md` note when the behavior differs between major versions.