Re: short_open_tag

From: Date: Wed, 16 Oct 2002 16:17:03 +0000
Subject: Re: short_open_tag
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-89574@lists.php.net to get a copy of this message
Since the general consensus by the developers is not to remove the short_tags or even disable them. Perhaps we should consider alternate solutions to this problem. Given the buzzword popularity of XML and its slowly growing popularity among website designers (XHTML) this issue is likely to come up in the future yet again. The solution I would like to offer, is a patch that adds special handling for <?xml. Thus preventing the language parser from attempting to parse data inside <?xml as PHP source. Ilia

Index: zend_language_scanner.l =================================================================== RCS file: /repository/Zend/zend_language_scanner.l,v retrieving revision 1.49 diff -u -3 -p -r1.49 zend_language_scanner.l --- zend_language_scanner.l 15 Aug 2002 00:22:38 -0000 1.49 +++ zend_language_scanner.l 16 Oct 2002 16:07:27 -0000 @@ -1194,6 +1194,14 @@ NEWLINE ("\r"|"\n"|"\r\n") } +<INITIAL>"<?xml"{WHITESPACE} { + zendlval->value.str.val = (char *) estrndup(yytext, yyleng); + zendlval->value.str.len = yyleng; + zendlval->type = IS_STRING; + return T_INLINE_HTML; +} + + <INITIAL>"<%="|"<?=" { if ((yytext[1]=='%' && CG(asp_tags)) || (yytext[1]=='?' && CG(short_tags))) { zendlval->value.str.val = yytext; /* no copying - intentional */
« previous php.dev (#89574) next »