Bug #74312 [Com]: Filter BOMs out of PHP output
[email protected] ("spam2 at rhsoft dot net")
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
Edit report at https://bugs.php.net/bug.php?id=74312&edit=1 ID: 74312 Comment by: spam2 at rhsoft dot net Reported by: furun at arcor dot de Summary: Filter BOMs out of PHP output Status: Open Type: Bug Package: Unicode Engine related Operating System: Win7 PHP Version: 7.0.17 Block user comment: N Private report: N New Comment: This is simply not possible because the BOM is not part of the php output at all - php don't and must not care about anything outside of <?php ?> Previous Comments: ------------------------------------------------------------------------ [2017-03-25 21:01:59] furun at arcor dot de Description: ------------ PHP send the BOM (before the tag "<?php") to the output. This is a source for some very strange buggy behavior, which are sometimes very difficult to find, because a developer searches errors first in the code it self and not in a mostly invisible BOM. (I searched a "bug" in a image creating script for long time, before i found the BOM-Bug in a third party plugin far away from the "buggy code". The common "Headers already sent" error caused by the BOM are still confusing, but easier to find then a corrupted binary file.) I would suggest that PHP filters every BOM from PHP output. (Or is there any reason not to do so i not know of?) Test script: --------------- (Use any file with BOM) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74312&edit=1