#21497 [Bgs]: include() of XML document fails
| From: | jtate@php.net | Date: | Tue, 25 Mar 2003 15:16:44 +0000 |
| Subject: | #21497 [Bgs]: include() of XML document fails | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-36395@lists.php.net to get a copy of this message | ||
ID: 21497
Updated by: jtate@php.net
Reported By: polone at townnews dot com
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: RedHat Linux 6.2
PHP Version: 4.3.0
New Comment:
This will not be fixed by any current member of the PHP development
group. If you desire a fix, submit a patch (though some have already
tried and haven't been sucessfull in getting the patches accepted),
otherwise, remove all your short tags. There are a number of problems
with using short tags, and therefore reasons that you shouldn't use
them in your code. The most prominent is that using short tags makes
your code essentially non-portable. This from the current php.ini:
; Allow the <? tag. Otherwise, only <?php and <script> tags are
recognized.
; NOTE: Using short tags should be avoided when developing applications
or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable
code,
; be sure not to use short tags.
Previous Comments:
------------------------------------------------------------------------
[2003-03-24 20:29:47] mike at sydel dot net
I am also experiencing this problem. Indeed, polone is right that
disabling short tags shouldn't be the solution. I say this because a
lot of people are already using <?=$var?> to simply echo variables. If
they for one case also encountered the same problem as we have, then he
has to rewrite the code where <?= is located.
Besides, short tags is a feature that helps a lot.
------------------------------------------------------------------------
[2003-01-07 14:17:17] polone at townnews dot com
That does fix the problem, but enabling short open tags shouldn't
invalidate properly formatted processing instructions for something
other than PHP.
In addition, this cannot be altered or disabled by ini_set() from a PHP
script (perhaps a security risk?) at run-time.
------------------------------------------------------------------------
[2003-01-07 13:17:31] edink@php.net
Disable short_open_tags in your php.ini and the problem will go away.
------------------------------------------------------------------------
[2003-01-07 13:15:12] polone at townnews dot com
When using the include(), include_once(), require(), or require_once()
functions, documents beginning with:
<?xml version="1.0"?>
fail to be loaded. I'm guessing this might have to do with PHP trying
to interpret the <?xml as <?php, causing a fatal error. Proper
operation should check for the processing instruction (PI) value of <?,
that is:
<? or <?php
maybe interpreted as PHP, but not,
<?some_other_text
at the very least, not:
<?xml
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21497&edit=1