[SREZIC - Wed Dec 7 09:07:13 2005]:
Show quoted text> [ABELTJE - Sun Dec 4 06:21:06 2005]:
...
Show quoted text> > +sub ct_can_validate {
> > + my( $self, $ua ) = @_;
> > +
> > + return $ua->ct =~ m[^text/html] ||
> > + $ua->ct =~ m[^text/xhtml] ||
> > + $ua->ct =~ m[^application/xhtml+xml] ||
> > + $ua->ct =~ m[^application/vnd.wap.xhtml+xml];
Show quoted text>
> I have to reopen the bug --- the regexpes should of course have "+"
> and "." escaped. Or rewrite it to use index() instead.
I hope this is ok then:
Index: lib/WWW/CheckSite/Validator.pm
=========================================================
==========
--- lib/WWW/CheckSite/Validator.pm (revision 439)
+++ lib/WWW/CheckSite/Validator.pm (working copy)
@@ -4,7 +4,7 @@
# $Id$
use vars qw( $VERSION $VALIDATOR_URL $VALIDATOR_FRM $VALIDATOR_STYLE );
-$VERSION = '0.010';
+$VERSION = '0.011';
=head1 NAME
@@ -534,10 +534,10 @@
sub ct_can_validate {
my( $self, $ua ) = @_;
- return $ua->ct =~ m[^text/html] ||
- $ua->ct =~ m[^text/xhtml] ||
- $ua->ct =~ m[^application/xhtml+xml] ||
- $ua->ct =~ m[^application/vnd.wap.xhtml+xml];
+ return $ua->ct =~ m[^\Qtext/html\E] ||
+ $ua->ct =~ m[^\Qtext/xhtml\E] ||
+ $ua->ct =~ m[^\Qapplication/xhtml+xml\E] ||
+ $ua->ct =~ m[^\Qapplication/vnd.wap.xhtml+xml\E];
}
=head2 $wcs->set_action
HTH,
-- Abe.