Skip Menu |

This queue is for tickets about the HTML-Prototype CPAN distribution.

Report information
The Basics
Id: 17590
Status: resolved
Worked: 10 min
Priority: 0/
Queue: HTML-Prototype

People
Owner: perl [...] intertivityNOSP4M.com
Requestors: attn.steven.kuo [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.43
Fixed in: (no value)



Subject: form_remote_tag returns wrongly encoded (HTML::Entities::encode_entities) string
$ perl -MHTML::Prototype -le 'my $p = HTML::Prototype->new; print $p->form_remote_tag( { url => "foo", update => "bar" } );' Produces: <form action="foo" method="post" onsubmit=" new Ajax.Updater( &#39;bar&#39;, &#39;foo&#39;, { parameters: Form.serialize(this),asynchronous: 1 } ) ; return false"> Instead of the expected <form action="foo" method="post" onsubmit=" new Ajax.Updater( 'bar', 'foo', { parameters: Form.serialize(this),asynchronous: 1 } ) ; return false">
Subject: Re: [rt.cpan.org #17590] form_remote_tag returns wrongly encoded (HTML::Entities::encode_entities) string
Date: Sun, 12 Feb 2006 13:54:00 +0100
To: bug-HTML-Prototype [...] rt.cpan.org
From: Marcus Ramberg <marcus [...] thefeed.no>
not that I maintain HTML-Prototype, but isn't that a HTML::Entities bug? On 2/11/06, Guest via RT <bug-HTML-Prototype@rt.cpan.org> wrote: Show quoted text
> > > Sat Feb 11 14:12:43 2006: Request 17590 was acted upon. > Transaction: Ticket created by guest > Queue: HTML-Prototype > Subject: form_remote_tag returns wrongly encoded > (HTML::Entities::encode_entities) > string > Owner: Nobody > Requestors: attn.steven.kuo@gmail.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=17590 > > > > $ perl -MHTML::Prototype -le 'my $p = HTML::Prototype->new; > print $p->form_remote_tag( { url => "foo", update => "bar" } );' > > Produces: > > <form action="foo" method="post" onsubmit=" new Ajax.Updater( > &#39;bar&#39;, &#39;foo&#39;, { parameters: > Form.serialize(this),asynchronous: 1 } ) ; return false"> > > > Instead of the expected > > <form action="foo" method="post" onsubmit=" new Ajax.Updater( 'bar', > 'foo', { parameters: Form.serialize(this),asynchronous: 1 } ) ; return > false"> > >
-- With regards Marcus Ramberg
Subject: Re: [rt.cpan.org #17590] form_remote_tag returns wrongly encoded (HTML::Entities::encode_entities) string
Date: Sun, 12 Feb 2006 16:58:00 -0800
To: bug-HTML-Prototype [...] rt.cpan.org
From: Steven Kuo <attn.steven.kuo [...] gmail.com>
On 2/12/06, marcus@thefeed.no via RT <bug-HTML-Prototype@rt.cpan.org> wrote: Show quoted text
> On 2/11/06, Guest via RT <bug-HTML-Prototype@rt.cpan.org> wrote:
> >
... Show quoted text
> > > > $ perl -MHTML::Prototype -le 'my $p = HTML::Prototype->new; > > print $p->form_remote_tag( { url => "foo", update => "bar" } );' > > > > Produces: > > > > <form action="foo" method="post" onsubmit=" new Ajax.Updater( > > &#39;bar&#39;, &#39;foo&#39;, { parameters: > > Form.serialize(this),asynchronous: 1 } ) ; return false"> > > > > > > Instead of the expected > > > > <form action="foo" method="post" onsubmit=" new Ajax.Updater( 'bar', > > 'foo', { parameters: Form.serialize(this),asynchronous: 1 } ) ; return > > false"> > >
Show quoted text
> not that I maintain HTML-Prototype, but isn't that a HTML::Entities bug? > > > -- > With regards > Marcus Ramberg
Perhaps -- I don't know where to find an an authoritative list of "unsafe characters". HTML::Entities, however, does allow one to specify the characters to be escaped: encode_entities_numeric( $string ) encode_entities_numeric( $string, $unsafe_chars ) As far as HTML::Prototype is concerned, I can suggest a patch (to HTML::Prototype::Helper::Tag). In the _tag method I changed: 173,179c173 < < local *_; < my $unsafe_chars = q{<&>"}; < $unsafe_chars .= chr($_) for (0x00 .. 0x1f, 0x7f .. 0xff); < $unsafe_chars =~ tr/\n\r\t//d; < < return $tag->starttag($unsafe_chars) if $starttag; --- Show quoted text
> return $tag->starttag if $starttag;
where $tag is a HTML::Element object and the starttag method invokes HTML::Entities::encode_entities, passing along its argument. -- Regards, Steven
Subject: RE: [rt.cpan.org #17590] form_remote_tag returns wrongly encoded (HTML::Entities::encode_entities) string
Date: Mon, 13 Feb 2006 19:42:52 +0100
To: <bug-HTML-Prototype [...] rt.cpan.org>
From: "Sascha Kiefer" <perl [...] intertivity.com>
Well, this is actually already possible, but NOT for the form_remote_tag (find the entities option in the documentation). The thing is, that the form_remote_tag uses as_XML function to create the output data, but all other use the as_HTML output Function. I was wondering the other night, wether or not i could replace the as_XML by as_HTML. Does anybody know? --esskar Show quoted text
> -----Original Message----- > From: attn.steven.kuo@gmail.com via RT > [mailto:bug-HTML-Prototype@rt.cpan.org] > Sent: Montag, 13. Februar 2006 01:59 > To: undisclosed-recipients: > Subject: Re: [rt.cpan.org #17590] form_remote_tag returns > wrongly encoded (HTML::Entities::encode_entities) string > > > > <URL: http://rt.cpan.org/Ticket/Display.html?id=17590 > > > On 2/12/06, marcus@thefeed.no via RT > <bug-HTML-Prototype@rt.cpan.org> wrote: > >
> > On 2/11/06, Guest via RT <bug-HTML-Prototype@rt.cpan.org> wrote:
> > >
> > ... >
> > > > > > $ perl -MHTML::Prototype -le 'my $p = HTML::Prototype->new; print > > > $p->form_remote_tag( { url => "foo", update => "bar" } );' > > > > > > Produces: > > > > > > <form action="foo" method="post" onsubmit=" new Ajax.Updater( > > > &#39;bar&#39;, &#39;foo&#39;, { parameters: > > > Form.serialize(this),asynchronous: 1 } ) ; return false"> > > > > > > > > > Instead of the expected > > > > > > <form action="foo" method="post" onsubmit=" new
> Ajax.Updater( 'bar',
> > > 'foo', { parameters: Form.serialize(this),asynchronous: 1 } ) ; > > > return false"> > > >
> >
> > not that I maintain HTML-Prototype, but isn't that a HTML::Entities > > bug? > > > > > > -- > > With regards > > Marcus Ramberg
> > > Perhaps -- I don't know where to find an an authoritative list > of "unsafe characters". HTML::Entities, however, does allow one to > specify the characters to be escaped: > > encode_entities_numeric( $string ) > encode_entities_numeric( $string, $unsafe_chars ) > > As far as HTML::Prototype is concerned, I can suggest a > patch (to HTML::Prototype::Helper::Tag). In the _tag > method I changed: > > 173,179c173 > < > < local *_; > < my $unsafe_chars = q{<&>"}; > < $unsafe_chars .= chr($_) for (0x00 .. 0x1f, 0x7f .. 0xff); > < $unsafe_chars =~ tr/\n\r\t//d; > < > < return $tag->starttag($unsafe_chars) if $starttag; > ---
> > return $tag->starttag if $starttag;
> > > where $tag is a HTML::Element object and > the starttag method invokes HTML::Entities::encode_entities, > passing along its argument. > > -- > Regards, > Steven >
will be fixed in next version by tonite.
will be fixed in next version by tonite.