Problem with fix for bug #31672

php.internals

Zeev Suraski

21 years ago
Guys, I'd like to revert the fix for bug #31672 ("</script> is not considered closing tag if preceded by one-line comment"). While theoretically correct, I'd rather resolve it by fixing the docs. The reason is simple - unlike ?> and %>, the string "</script>" is very much likely to appear inside one line comments: // print "<script>foo</script>"; That suddenly fails. That's probably the reason we didn't implement it in the first place. Any objections to reverting this fix? Zeev

Ilia A.

21 years ago
Good point, +1 for revert. Ilia Zeev Suraski wrote:

M. Sokolewicz

21 years ago
I very much agree with this. It's very common to output JavaScript via PHP, and that also uses the <script></script> tags...so... Ilia Alshanetsky wrote:

Marcus Börger

21 years ago
Hello Zeev, i do not think this is a good excuse for ignoring xml compliance. marcus Monday, March 7, 2005, 3:10:57 PM, you wrote:
> Guys,
> I'd like to revert the fix for bug #31672 ("</script> is not considered > closing tag if preceded by one-line comment"). While theoretically > correct, I'd rather resolve it by fixing the docs.
> The reason is simple - unlike ?> and %>, the string "</script>" is very > much likely to appear inside one line comments:
> // print "<script>foo</script>";
> That suddenly fails. That's probably the reason we didn't implement it in > the first place.
> Any objections to reverting this fix?
> Zeev
-- Best regards, Marcus mailto:helly@php.net

Zeev Suraski

21 years ago
At 20:38 07/03/2005, Marcus Boerger wrote:
>Hello Zeev, > > i do not think this is a good excuse for ignoring xml compliance.
I don't exactly follow what you're saying - can you elaborate? Zeev

Marcus Börger

21 years ago
Hello Zeev, Tuesday, March 8, 2005, 7:27:31 AM, you wrote:
> At 20:38 07/03/2005, Marcus Boerger wrote: >>Hello Zeev, >> >> i do not think this is a good excuse for ignoring xml compliance.
> I don't exactly follow what you're saying - can you elaborate?
I do not see any reason to make php a proprietary format ignoring xml rules just to allow some stupid simplification which is not needed at all. Every one that uses java script and and some server based scripting language knows that it is impossible to write closing tags completley into echo/print statements. Thus i suggesst we reintroduce the patch and live with the fact that we need to write echo "<"."/script>" instead of echo "</script>".
-- Best regards, Marcus mailto:helly@php.net

Zeev Suraski

21 years ago
At 13:34 08/03/2005, Marcus Boerger wrote:
>Hello Zeev, > >Tuesday, March 8, 2005, 7:27:31 AM, you wrote: > > > At 20:38 07/03/2005, Marcus Boerger wrote: > >>Hello Zeev, > >> > >> i do not think this is a good excuse for ignoring xml compliance. > > > I don't exactly follow what you're saying - can you elaborate? > >I do not see any reason to make php a proprietary format ignoring xml rules >just to allow some stupid simplification which is not needed at all.
Who says we're supposed to follow XML rules? And it's not a stupid simplification, it's the way the language works.
> Every >one that uses java script and and some server based scripting language knows >that it is impossible to write closing tags completley into echo/print >statements.
Hmm, I didn't know that. I don't think it's right either, you can write whatever the heck you want inside Javascript strings, including tags.
> Thus i suggesst we reintroduce the patch and live with the fact >that we need to write echo "<"."/script>" instead of echo "</script>".
Ouch, no way! I value my life, I don't feel like being lynched by a mob of angry users :) Zeev

Stanislav Malyshev

21 years ago
>>> Thus i suggesst we reintroduce the patch and live with the fact >>>that we need to write echo "<"."/script>" instead of echo "</script>".
If that was said some 5 years ago, it would be somewhat reasonable (though I would probably have some doubts even then, but it would be at least arguable). But now when I see this patch breaks live site in a way that takes me half an hour just to find it out - and that's while I KNOW about the patch and it's effects and can figure out what the hell is going on - try to imagine what would the average developer say. One that does not follow each patch on internals list. He would just refuse to upgrade to this version on grounds that "it breaks my site that worked before" and he'll be right. So what's the use in a "fix" that nobody would use - just to show how purist we are? Or do you imagine all the users would suddently See The Light (TM) and go and rewrite all their scripts? It won't happen. Nobody would rewrite working code just because someone thinks it's not nice for some obscured XML-purity reasons.
-- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115

Marcus Börger

21 years ago
Hello Zeev, Tuesday, March 8, 2005, 12:48:00 PM, you wrote:
>> Thus i suggesst we reintroduce the patch and live with the fact >>that we need to write echo "<"."/script>" instead of echo "</script>".
> Ouch, no way! I value my life, I don't feel like being lynched by a mob of > angry users :)
Ok then we should stick with things, it seemed to work acceptable so far and so we can keep you alive :-) best regards marcus

Marcus Börger

21 years ago
Hello Zeev, Tuesday, March 8, 2005, 12:48:00 PM, you wrote:
> At 13:34 08/03/2005, Marcus Boerger wrote: >> Thus i suggesst we reintroduce the patch and live with the fact >>that we need to write echo "<"."/script>" instead of echo "</script>".
> Ouch, no way! I value my life, I don't feel like being lynched by a mob of > angry users :)
Jani just had an interesting thought that brought me to this: If we'd store the opening tag and only allow the matching closing tag we won't have a problem with reintroducing the patch :-) marcus

Zeev Suraski

21 years ago
At 14:28 08/03/2005, Marcus Boerger wrote:
>Hello Zeev, > >Tuesday, March 8, 2005, 12:48:00 PM, you wrote: > > > At 13:34 08/03/2005, Marcus Boerger wrote: > >> Thus i suggesst we reintroduce the patch and live with the fact > >>that we need to write echo "<"."/script>" instead of echo "</script>". > > > Ouch, no way! I value my life, I don't feel like being lynched by a mob of > > angry users :) > >Jani just had an interesting thought that brought me to this: If we'd store >the opening tag and only allow the matching closing tag we won't have a >problem with reintroducing the patch :-)
I didn't quite understand that suggestion, but seriously guys - we've been with this thing for 8 years now, very few people use the <script language=php> syntax, why waste time and bandwidth over it? Zeev

Jani Taskinen

21 years ago
On Tue, 8 Mar 2005, Zeev Suraski wrote:
> At 14:28 08/03/2005, Marcus Boerger wrote: >> Hello Zeev, >> >> Tuesday, March 8, 2005, 12:48:00 PM, you wrote: >> >> > At 13:34 08/03/2005, Marcus Boerger wrote: >> >> Thus i suggesst we reintroduce the patch and live with the fact >> >>that we need to write echo "<"."/script>" instead of echo "</script>". >> >> > Ouch, no way! I value my life, I don't feel like being lynched by a mob >> of >> > angry users :) >> >> Jani just had an interesting thought that brought me to this: If we'd store >> the opening tag and only allow the matching closing tag we won't have a >> problem with reintroducing the patch :-) > > I didn't quite understand that suggestion, but seriously guys - we've been > with this thing for 8 years now, very few people use the <script language=php> > syntax, why waste time and bandwidth over it?
One thing would be nice: to be able to disable that <script..> tag. Like you can disable short tag and asp-tag. (with an ini option =) --Jani