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(
> > 'bar', 'foo', { 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