You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Guillaume Smet <gu...@gmail.com> on 2013/12/17 21:39:47 UTC

Should EnumChoiceRenderer really escape the markup?

Hi,

Currently, EnumChoiceRenderer escapes the value via the postprocess method.

It seems to be redundant with the fact that DropDownChoice already
escapes the value by default (in AbstractChoice).

Typically, in a default setup, if you use EnumChoiceRenderer and
DropDownChoice together, your value is escaped twice which leads to a
double escaped value.

Should I open a JIRA so that we remove the escaping of EnumChoiceRenderer?

References:
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/html/form/EnumChoiceRenderer.java#L111
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractChoice.java#L402

Thanks for your feedback.

-- 
Guillaume

RE: Should EnumChoiceRenderer really escape the markup?

Posted by "Burton, Tom F (DOR)" <to...@alaska.gov>.
Thank you for the quick response and clarification.

-----Original Message-----
From: Martin Grigorov [mailto:mgrigorov@apache.org] 
Sent: Tuesday, December 17, 2013 12:20 PM
To: dev@wicket.apache.org
Subject: Re: Should EnumChoiceRenderer really escape the markup?

On Tue, Dec 17, 2013 at 11:17 PM, Burton, Tom F (DOR) <tom.burton@alaska.gov
> wrote:

> I'm still using Wicket 1.5 for my applications, so my knowledge of the 
> code is probably out of date.
> Should this be 1 JIRA issue or 2?
>
> If someone passes in escaped code to: Strings.escapeMarkup()
>
> Should the code be escaped twice? Or should Strings.escapeMarkup() be 
> smart enough to recognize that's been escaped and ignore it?
>

Wicket usually prefers to take the "no magic way".
So, it will be escaped twice.


>
>
> Tom Burton
>
>
> -----Original Message-----
> From: Sven Meier [mailto:sven@meiers.net]
> Sent: Tuesday, December 17, 2013 11:47 AM
> To: dev@wicket.apache.org
> Subject: Re: Should EnumChoiceRenderer really escape the markup?
>
> Please open a JIRA issue.
>
> Sven
>
> On 12/17/2013 09:39 PM, Guillaume Smet wrote:
> > Hi,
> >
> > Currently, EnumChoiceRenderer escapes the value via the postprocess
> method.
> >
> > It seems to be redundant with the fact that DropDownChoice already 
> > escapes the value by default (in AbstractChoice).
> >
> > Typically, in a default setup, if you use EnumChoiceRenderer and 
> > DropDownChoice together, your value is escaped twice which leads to 
> > a double escaped value.
> >
> > Should I open a JIRA so that we remove the escaping of
> EnumChoiceRenderer?
> >
> > References:
> > https://github.com/apache/wicket/blob/master/wicket-core/src/main/ja
> > va
> > /org/apache/wicket/markup/html/form/EnumChoiceRenderer.java#L111
> > https://github.com/apache/wicket/blob/master/wicket-core/src/main/ja
> > va
> > /org/apache/wicket/markup/html/form/AbstractChoice.java#L402
> >
> > Thanks for your feedback.
> >
>
>

Re: Should EnumChoiceRenderer really escape the markup?

Posted by Martin Grigorov <mg...@apache.org>.
On Tue, Dec 17, 2013 at 11:17 PM, Burton, Tom F (DOR) <tom.burton@alaska.gov
> wrote:

> I'm still using Wicket 1.5 for my applications, so my knowledge of the
> code is probably out of date.
> Should this be 1 JIRA issue or 2?
>
> If someone passes in escaped code to: Strings.escapeMarkup()
>
> Should the code be escaped twice? Or should Strings.escapeMarkup() be
> smart enough to recognize that's been escaped and ignore it?
>

Wicket usually prefers to take the "no magic way".
So, it will be escaped twice.


>
>
> Tom Burton
>
>
> -----Original Message-----
> From: Sven Meier [mailto:sven@meiers.net]
> Sent: Tuesday, December 17, 2013 11:47 AM
> To: dev@wicket.apache.org
> Subject: Re: Should EnumChoiceRenderer really escape the markup?
>
> Please open a JIRA issue.
>
> Sven
>
> On 12/17/2013 09:39 PM, Guillaume Smet wrote:
> > Hi,
> >
> > Currently, EnumChoiceRenderer escapes the value via the postprocess
> method.
> >
> > It seems to be redundant with the fact that DropDownChoice already
> > escapes the value by default (in AbstractChoice).
> >
> > Typically, in a default setup, if you use EnumChoiceRenderer and
> > DropDownChoice together, your value is escaped twice which leads to a
> > double escaped value.
> >
> > Should I open a JIRA so that we remove the escaping of
> EnumChoiceRenderer?
> >
> > References:
> > https://github.com/apache/wicket/blob/master/wicket-core/src/main/java
> > /org/apache/wicket/markup/html/form/EnumChoiceRenderer.java#L111
> > https://github.com/apache/wicket/blob/master/wicket-core/src/main/java
> > /org/apache/wicket/markup/html/form/AbstractChoice.java#L402
> >
> > Thanks for your feedback.
> >
>
>

RE: Should EnumChoiceRenderer really escape the markup?

Posted by "Burton, Tom F (DOR)" <to...@alaska.gov>.
I'm still using Wicket 1.5 for my applications, so my knowledge of the code is probably out of date.
Should this be 1 JIRA issue or 2?  

If someone passes in escaped code to: Strings.escapeMarkup()

Should the code be escaped twice? Or should Strings.escapeMarkup() be smart enough to recognize that's been escaped and ignore it?


Tom Burton


-----Original Message-----
From: Sven Meier [mailto:sven@meiers.net] 
Sent: Tuesday, December 17, 2013 11:47 AM
To: dev@wicket.apache.org
Subject: Re: Should EnumChoiceRenderer really escape the markup?

Please open a JIRA issue.

Sven

On 12/17/2013 09:39 PM, Guillaume Smet wrote:
> Hi,
>
> Currently, EnumChoiceRenderer escapes the value via the postprocess method.
>
> It seems to be redundant with the fact that DropDownChoice already 
> escapes the value by default (in AbstractChoice).
>
> Typically, in a default setup, if you use EnumChoiceRenderer and 
> DropDownChoice together, your value is escaped twice which leads to a 
> double escaped value.
>
> Should I open a JIRA so that we remove the escaping of EnumChoiceRenderer?
>
> References:
> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java
> /org/apache/wicket/markup/html/form/EnumChoiceRenderer.java#L111
> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java
> /org/apache/wicket/markup/html/form/AbstractChoice.java#L402
>
> Thanks for your feedback.
>


Re: Should EnumChoiceRenderer really escape the markup?

Posted by Guillaume Smet <gu...@gmail.com>.
Hi Sven,

Done: https://issues.apache.org/jira/browse/WICKET-5450

Thanks for your feedback.

On Tue, Dec 17, 2013 at 9:47 PM, Sven Meier <sv...@meiers.net> wrote:
> Please open a JIRA issue.
>
> Sven
>
>
> On 12/17/2013 09:39 PM, Guillaume Smet wrote:
>>
>> Hi,
>>
>> Currently, EnumChoiceRenderer escapes the value via the postprocess
>> method.
>>
>> It seems to be redundant with the fact that DropDownChoice already
>> escapes the value by default (in AbstractChoice).
>>
>> Typically, in a default setup, if you use EnumChoiceRenderer and
>> DropDownChoice together, your value is escaped twice which leads to a
>> double escaped value.
>>
>> Should I open a JIRA so that we remove the escaping of EnumChoiceRenderer?
>>
>> References:
>>
>> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/html/form/EnumChoiceRenderer.java#L111
>>
>> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractChoice.java#L402
>>
>> Thanks for your feedback.
>>
>

Re: Should EnumChoiceRenderer really escape the markup?

Posted by Sven Meier <sv...@meiers.net>.
Please open a JIRA issue.

Sven

On 12/17/2013 09:39 PM, Guillaume Smet wrote:
> Hi,
>
> Currently, EnumChoiceRenderer escapes the value via the postprocess method.
>
> It seems to be redundant with the fact that DropDownChoice already
> escapes the value by default (in AbstractChoice).
>
> Typically, in a default setup, if you use EnumChoiceRenderer and
> DropDownChoice together, your value is escaped twice which leads to a
> double escaped value.
>
> Should I open a JIRA so that we remove the escaping of EnumChoiceRenderer?
>
> References:
> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/html/form/EnumChoiceRenderer.java#L111
> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractChoice.java#L402
>
> Thanks for your feedback.
>