[Mono-dev] [PATCH] System.Web.Compilation/AspTokenizer.cs
Konstantin Triger
kostat at mainsoft.com
Mon Jun 19 06:51:37 EDT 2006
Hi Juraj,
You are right, I missed the (!inServerTag) condition above. But I don't think parser/tokenizer should count quotes inside the inline server code (which is regulated by inServerTag flag, to my understanding). This is because parser/tokenizer should be unaware of the language the server side code written with and thus its syntax. If there is an error, the compilation should fail.
I think the
if (quoted && c == quoteChar) {
return Token.NOTWELLFORMED;
}
Should be moved to the (!inServerTag) condition scope, and this will do the trick.
Regards,
Konstantin Triger
-----Original Message-----
From: Juraj Skripsky [mailto:js at hotfeet.ch]
Sent: Monday, June 19, 2006 11:59 AM
To: Konstantin Triger
Cc: mono-devel-list at ximian.com
Subject: Re: [Mono-dev] [PATCH] System.Web.Compilation/AspTokenizer.cs
Hi,
The patch you propose is not quite right:
...
} else if (!inServerTag) {
...
...
} else if (!inServerTag && quoted && c == quoteChar) {
return Token.NOTWELLFORMED;
}
The case "!inServerTag" is already handled a few lines before, making
"return Token.NOTWELLFORMED" unreachable.
But there is a problem with fix 61757. The quoting rules (or rather the
rules of their nesting) change depending on whether we're inside a
server control or not.
We probably need to tokenize all attributes as if we're not inside a
server control, noting whether the stricter rules were violated or not.
After reading all attributes we check for the presence of runat="server"
and throw in the case of violation.
I'll have a look at it.
- Juraj
On Mon, 2006-06-19 at 01:17 -0700, Konstantin Triger wrote:
> Hello,
>
>
>
> Following the fix 61757: this code started throwing not well formed:
>
> <img src="Handler.ashx?PhotoID=<%# Eval("PhotoID") %>&Size=M" />
>
>
>
> This is because Eval(…) contains quotes. The attached patch fixes that
> by ignoring quotes inside server tag.
>
>
>
> Please review.
>
>
>
> Regards,
>
> Konstantin Triger
>
>
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
More information about the Mono-devel-list
mailing list