- From: Ville Skytta via cvs-syncmail <cvsmail@w3.org>
- Date: Sat, 25 Oct 2008 19:37:23 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/perl/modules/W3C/LinkChecker/bin
In directory hutz:/tmp/cvs-serv7524
Modified Files:
checklink
Log Message:
Check links in meta refresh tags.
Index: checklink
===================================================================
RCS file: /sources/public/perl/modules/W3C/LinkChecker/bin/checklink,v
retrieving revision 4.121
retrieving revision 4.122
diff -u -d -r4.121 -r4.122
--- checklink 25 Oct 2008 19:33:32 -0000 4.121
+++ checklink 25 Oct 2008 19:37:21 -0000 4.122
@@ -215,7 +215,8 @@
(exists($ENV{MOD_PERL_API_VERSION}) && $ENV{MOD_PERL_API_VERSION} >= 2);
# Tag=>attribute mapping of things we treat as links.
-# Note: base/@href gets a special treatment, see start() for details.
+# Note: base/@href and meta/@http-equiv get special treatment, see start()
+# for details.
use constant LINK_ATTRS => {
a => ['href'],
area => ['href'],
@@ -1584,6 +1585,8 @@
# Links
if (!$self->{only_anchors}) {
+ my $tag_local_base = undef;
+
# Special case: base/@href
# TODO: This should go away as soon as LWP::Protocol::collect() invokes
# HTML::HeadParser (thus taking care of it in $response->base()
@@ -1598,9 +1601,17 @@
# Note: base/@href intentionally not treated as a dereferenceable link:
# http://www.w3.org/mid/200802091439.27764.ville.skytta%40iki.fi
}
-
- my $tag_local_base = undef;
- if ($tag eq 'applet' || $tag eq 'object') {
+ # Special case: meta[@http-equiv=Refresh]/@content
+ elsif ($tag eq 'meta') {
+ if ($attr->{'http-equiv'} && lc($attr->{'http-equiv'}) eq 'refresh') {
+ my $content = $attr->{content};
+ if ($content && $content =~ /.*?;\s*(?:url=)?(.+)/i) {
+ $self->add_link($1, undef, $line);
+ }
+ }
+ }
+ # Special case: tags that have "local base"
+ elsif ($tag eq 'applet' || $tag eq 'object') {
if (my $codebase = $attr->{codebase}) {
# TODO: HTML 4 spec says applet/@codebase may only point to subdirs of
# the directory containing the current document. Should we do
Received on Saturday, 25 October 2008 19:37:32 UTC