Merge pull request #6900 from JediKev/issue/microsoft-utf8-bom

Reviewed-By: JediKev <kevin@enhancesoft.com>
This commit is contained in:
JediKev
2026-01-15 09:51:55 -06:00
committed by GitHub

View File

@@ -88,6 +88,10 @@ class Headers implements Countable, Iterator
*/
public static function fromString($string, $eol = self::EOL)
{
// PATCH: Strip UTF-8 BOM
if (preg_match("/^\xEF\xBB\xBF/", $string))
$string = preg_replace('/^\xEF\xBB\xBF/', '', $string);
$headers = new static();
$currentLine = '';
$emptyLine = 0;