Re: PHP 6.0 Wishlist

From: Date: Sun, 28 Aug 2005 08:18:57 +0000
Subject: Re: PHP 6.0 Wishlist
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-18504@lists.php.net to get a copy of this message
Johannes Schlueter wrote:
Hi Sara, On Sunday 28 August 2005 00:02, Sara Golemon wrote:
+<INITIAL>"<?xml"([ \t]|{NEWLINE}) {
And what's with <?xml-stylesheet ?> or any other processing instruction? Even so others than xml are rarely used it would imho be a great wtf factor if <?xml is somehow special. At a sidenote: If you output xml you anyways neet to set the right content-type header, so either set default_mimetype to text/xml (or similar) and turn of short_open_tags in the php.ini or start the file with a header() call followed by an echo of the xml-pi. If you replace the te following lines:
<INITIAL>"<?"|"<script"{WHITESPACE}+"language"{WHITESPACE}*"="{WHITESPACE}*("php"|"\"php\""|"\'php\'"){WHITESPACE}*">" { HANDLE_NEWLINES(yytext, yyleng); if (CG(short_tags) || yyleng>2) { /* yyleng>2 means it's not <? but <script> */ with: <INITIAL>"<? "|"<script"{WHITESPACE}+"language"{WHITESPACE}*"="{WHITESPACE}*("php"|"\"php\""|"\'php\'"){WHITESPACE}*">" { HANDLE_NEWLINES(yytext, yyleng); if (CG(short_tags) || yyleng>3) { /* yyleng>3 means it's not <? but <script> */ (notice the space behind '?' and the length check from 2 to 3) Wouldn't that fix the whole problem without creating a special case for <?xml ? David

« previous php.internals (#18504) next »