[php-src] PR #22343: Fix MIME charset sniffing advancing by name length not value length

From: Date: Tue, 16 Jun 2026 21:29:32 +0000
Subject: [php-src] PR #22343: Fix MIME charset sniffing advancing by name length not value length
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-36472@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/22343 Author: iliaal php_libxml_sniff_charset_from_string() advanced the parse cursor by the parameter name length after collecting an unquoted parameter value (WHATWG mime-sniff step 11.9.1), instead of the value length. A Content-Type whose parameter before charset has a name and value of different lengths (for example "text/html; abcd=ef;charset=ISO-8859-1") misaligns the cursor so the charset parameter is missed, and Dom\HTMLDocument loading falls back to the wrong encoding. The existing createFromFile HTTP-header test only used equal-length name=value pairs, which masked it.

« previous php.git-pulls (#36472) next »