From: mephtu at yahoo dot com
Operating system: linux
PHP version: 5.2.6
PHP Bug Type: Scripting Engine problem
Bug description: Incorrect handling of XML processing instructions in included
files
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 bug report at http://bugs.php.net/?id=45683&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=45683&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=45683&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=45683&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45683&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=45683&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45683&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45683&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45683&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45683&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45683&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=45683&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=45683&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45683&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45683&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45683&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45683&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45683&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45683&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45683&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45683&r=mysqlcfg