Bug #75187 [Com]: Unexpected extra characters output in file/page.

From: Date: Mon, 11 Sep 2017 12:58:53 +0000
Subject: Bug #75187 [Com]: Unexpected extra characters output in file/page.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211068@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75187&edit=1 ID: 75187 Comment by: spam2 at rhsoft dot net Reported by: frederic dot nicolas_xkpad at laposte dot net Summary: Unexpected extra characters output in file/page. Status: Open Type: Bug Package: *General Issues Operating System: DSM 6.1.3-15152 Update 4 PHP Version: 7.0.23 Block user comment: N Private report: N New Comment: this is simply not true and even not possible with the code you have given because PHP ends with "?>" and anything after that is echoed as it is - you pretty sure took some random code as sample while there where you see that output much more and likely output buffers are involved [harry@rh:/mnt/data/downloads]$ php test.php <html> qqqqqqqqqq<script> <!-- <a --> </script> </html> [harry@rh:/mnt/data/downloads]$ cat test.php <html> <?php $z = 10; for ($i=0; $i<$z; $i++) echo "q"; ?> <script> <!-- <a --> </script> </html> Previous Comments: ------------------------------------------------------------------------ [2017-09-11 12:40:39] frederic dot nicolas_xkpad at laposte dot net Description: ------------ Unexpected extra characters output in file/page, creating not working page when these unexpected characters interfer with JS/Html code in the output page. Exemple provided. According to tests on my side regarding this exemple: - can change the letter "a" (in "<a") to whatever letter + add other letters - cannot suppress other character after "<script>" but lot more character can be added in the <script>..</script> part - the position of the unexpected extra character changes according to the number of characters/line in the <script>..</script> part In the code where I noticed the problem, there where many characters before the <script> part, which itself included several JS functions. The unexepected extra character make the JS not working. Test script: --------------- <html> <?php $z = 98270; for ($i=0; $i<$z; $i++) echo "q"; ?> <script> <!-- <a --> </script> </html> Expected result: ---------------- <html> ....qq<script> <!-- <a --></script> </html> Actual result: -------------- <html> ....qq<script> <!-- <a --></a/script> </html> ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75187&edit=1

« previous php.bugs (#211068) next »