#45683 [Opn->Bgs]: Incorrect handling of XML processing instructions in included files

From: Date: Fri, 01 Aug 2008 22:21:08 +0000
Subject: #45683 [Opn->Bgs]: Incorrect handling of XML processing instructions in included files
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-127483@lists.php.net to get a copy of this message
ID: 45683 Updated by: jani@php.net Reported By: mephtu at yahoo dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: linux PHP Version: 5.2.6 New Comment: Disable short_open_tag in your php.ini. No bug. Previous Comments: ------------------------------------------------------------------------ [2008-08-01 22:11:19] mephtu at yahoo dot com Description: ------------ Using apache 2.0, I added a content handler for XML files so they get processed by a PHP script. I want to include XML files into an output buffer but I get an "Unexpected T_STRING" parse error from the "<?xml version="1.0"?> processing instruction. This is because PHP is, incorrectly, parsing all processing instructions as PHP code. httpd.conf: ... AcceptPathInfo On ... .htaccess: ... Action process ./process.php AddHandler process .xml ... Reproduce code: --------------- process.php: <?php ob_start(); include($_SERVER("PATH_TRANSLATED")); ob_end_flush(); ?> content.xml: <?xml version="1.0"?> <tag>some data</tag> Expected result: ---------------- I expect to see the following in "view source" in my browser: <?xml version="1.0"?> <tag>some data</tag> Actual result: -------------- PHP incorrectly attempts to parse the XML declaration at the beginning of content.xml giving an "Unexpected T_STRING, line 1, content.xml" error. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45683&edit=1

« previous php.bugs (#127483) next »