ID: 16838
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Analyzed
Bug Type: Scripting Engine problem
Operating System: all
PHP Version: 4.2.0
New Comment:
We shortly stumbled into that 'problem', too. Actually a contractor of
ours did, that is.
- We are sending everything through php, even static html. We do not
have much, kiss (keep is stupid simple) and there some statistics
reasons.
- We host several loosely relatd sites, for clients who sometimes (let)
code on their own; we add to theis sites, some other stuff is directly
outsourced by us.
- a young employee of one of our contractors recently approached me
with a nicely made several-pages paper demonstrating a "bug in he
server" ! Yes alas, he tried to use xml, clashed with php short tags,
and here you go! He had no real knowledge of php at all, and he did
not know we were using it, anyways.
- I scanned our site for short tags: Found many. I tried to
auto-replace them with long tags: many sites did not work any more. I
tried to also replace "<?=" with "<?php echo" and it also did not work
:-(
- I ran a q&d count against our web sites & found roughly as many "<?"
as ("<?[:whitespace:]" plus "<?=" plus "<?php") so
=> I propose to add an option to the php.ini that restricts short tags
to ones like "<?" followed by whitespace or followed by "=" and leaves
everything else alone.
Pu <[EMAIL PROTECTED]>
Previous Comments:
------------------------------------------------------------------------
[2002-04-26 11:43:24] [EMAIL PROTECTED]
Only good solution is to get rid of the short tags.
It only saves you 3 keystrokes..
------------------------------------------------------------------------
[2002-04-26 11:41:25] [EMAIL PROTECTED]
Only good solution is to get rid of the short tags.
It only saves you 3 keystrokes..
------------------------------------------------------------------------
[2002-04-26 11:10:08] [EMAIL PROTECTED]
people have been warned for *ages* now
that short tags are *not* xml-compliant,
so everybody still using them should be
blamed for doing so and not benn supported
in continuing using bad style ...
instead of adding extra magic i'd suggest
to emmit warnings for uses of '<?' even
if short_tags are enabled ...
------------------------------------------------------------------------
[2002-04-26 06:28:43] [EMAIL PROTECTED]
Hi,
turning off short tags is not a real solution as long as PHP offically
supports them. There are tons of code out there using short tags and
there will be even more new code with short tags if this feature will
not be abolished.
Furthermore, and I have to repeat this, there is huge group of PHP
users that has no access to the php.ini settings (e.g. mod_php with
safe_mode in a shared hosting environment). Should these users be
forced to modify third-party code over and over again because the
developers of this code insist on (offically supported) short tags? For
companies and groups that offer web hosting services this is simply not
viable. You can't over web hosting with mutual exclusion of XHTML and
PHP.
And I also have to stress that again: PHP, a *hypertext preprocessor*,
is not able to parse standard compliant XHTML!
I think there are only two solutions: Doing it the hard way by wholly
removing short tags or changing PHP in a way that allows the usage of
XHTML and short tags.
A third approach to this problem is not a real solution but an option
for the user, namely switching to another scripting language.
Sascha
------------------------------------------------------------------------
[2002-04-26 05:51:35] [EMAIL PROTECTED]
Then just turn off short-tags.
And there won't be any change in this, as:
1. It came up numerous times on php-dev
2. It makes little sense
Derick
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/16838
--
Edit this bug report at http://bugs.php.net/?id=16838&edit=1