Bug #72556 [Nab]: php using .xml file as source tries to execute header
| From: | jim dot michaels at Jesusnjim dot com | Date: | Sat, 09 Jul 2016 23:49:17 +0000 |
| Subject: | Bug #72556 [Nab]: php using .xml file as source tries to execute header | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-202151@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72556&edit=1
ID: 72556
User updated by: jim dot michaels at Jesusnjim dot com
Reported by: jim dot michaels at Jesusnjim dot com
Summary: php using .xml file as source tries to execute
header
Status: Not a bug
Type: Bug
Package: Scripting Engine problem
PHP Version: 7.0Git-2016-07-06 (snap)
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
you blasted me. I asked you not to. too many bugs to handle? do you need prayer or something?
try 2 hours rest on your bed and see if things get better real fast, thinking about nothing in
particular.
I forgive.
the problem here is in the EBNF and the way it detects those short tags. I had thought short-tags
was deprecated or dropped from what I remember.
try parsing these in order:
<?xml - ignore
<?php - process as PHP
<? - process as PHP
if you do short tags first, <?php will never see light of day for proper detection.
Previous Comments:
------------------------------------------------------------------------
[2016-07-06 20:08:37] cmb@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
> 7.1Git-2016-07-06 isn't even on your site - no dir for it.
php.net does not package Git snapshots, as you can easily get them
yourself, see <http://php.net/git.php>.
> php using .xml file as source tries to execute XML header
> because of <? and ?> but xml header says <?xml version='1.0'
> encoding='UTF-8'?>
If you don't like that behavior, just disable short_open_tag, see
<http://php.net/manual/en/ini.core.php#ini.short-open-tag>.
------------------------------------------------------------------------
[2016-07-06 19:11:24] jim dot michaels at Jesusnjim dot com
Description:
------------
1. 7.1Git-2016-07-06 isn't even on your site - no dir for it.
2. php using .xml file as source tries to execute XML header because of <? and ?> but xml
header says <?xml version='1.0' encoding='UTF-8'?>
don't blast me because they are not separate bugs please. you know what happens if too many are
put in on the same day.
Test script:
---------------
<?xml version='1.0' encoding='UTF-8'?>
Expected result:
----------------
<?xml should be differentiated from <?php. in fact, it might be a lex priority issue where
<? is lexed before <?php but XML and XHTML are not detected properly due to same problem. what
is the header for XHTML 1.1/1.0? what about XHTML5? XHTML5.1? 5.2? see whatwg.org
php should completely ignore the xml file since there is no PHP in it. or so I had thought. and
it's not just a simple .xml file extension detection, it's an ENBF change, yes?
Actual result:
--------------
Wed 07/06/2016 11:49:00.42|C:\w\Jesusnjim|>php menu7a.xml
Parse error: syntax error, unexpected 'version' (T_STRING) in C:\w\Jesusnjim\menu7a.xml on
line 1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72556&edit=1