This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 12720 - Link resolution ignores <base href="" /> for relative links
Summary: Link resolution ignores <base href="" /> for relative links
Status: RESOLVED FIXED
Alias: None
Product: LinkChecker
Classification: Unclassified
Component: checklink (show other bugs)
Version: 4.8
Hardware: PC Windows XP
: P2 normal
Target Milestone: 4.81
Assignee: Ville Skyttä
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-22 22:04 UTC by Michael Bowen
Modified: 2011-05-23 19:51 UTC (History)
0 users

See Also:


Attachments

Description Michael Bowen 2011-05-22 22:04:47 UTC
When resolving relative links such as

 <img src="img/vccoursepg.gif" />

the link checker appears to use the document being checked as the base from which to reconstruct the complete URL, instead of the base specified in the <head> of the document using the <base href="" /> element (in those cases when the latter is present). This causes the link checker to create non-existent URLs, about which it then proceeds to complain.

Example URL of document with this problem:
  http://academic.venturacollege.edu/mbowen/courses/2011haru/grading_status.shtml

Base specification coded within this page:
  <head><base href="http://academic.venturacollege.edu/mbowen/index.shtml" /></head>
 
Example of a link from this page that works in browsers but is flagged by Linkchecker (I will call this the "tail"):
  <img src="img/vccoursepg.gif" />

URL which Linkchecker *should* be constructing to test (base directory + tail), and which my browser (Firefox 3.x, 4.x) also successfully constructs:
  http://academic.venturacollege.edu/mbowen/img/vccoursepg.gif

Nonexistent URL which Linkchecker actually constructs to test (directory of source page + tail):
  http://academic.venturacollege.edu/mbowen/courses/2011haru/img/vccoursepg.gif
Comment 1 Ville Skyttä 2011-05-23 16:20:13 UTC
You are right, this appears to be a regression introduced in link checker version 4.7 and still present in 4.8 - it works in version 4.6 in my local tests.  Thank you for the report, will look into it ASAP.
Comment 2 Ville Skyttä 2011-05-23 19:51:45 UTC
Should be fixed now in the link checker development instance running at http://qa-dev.w3.org/wlc/checklink