avoid adding ./ to urls unnecessarily
This avoids constructing urls like "./../foo/". The leading "../" avoids any colon confusion already. I noticed in my logs that certain badly written web spiders (hello again, Yahoo!) fail to follow urls like ikiwiki was constructing to the right place (instead ending up at "./foo/")
parent
17659599f3
commit
dca6c835fe
|
@ -942,9 +942,9 @@ sub beautify_urlpath ($) { #{{{
|
|||
$url =~ s!/index.$config{htmlext}$!/!;
|
||||
}
|
||||
|
||||
# Ensure url is not an empty link, and
|
||||
# if it's relative, make that explicit to avoid colon confusion.
|
||||
if ($url !~ /^\//) {
|
||||
# Ensure url is not an empty link, and if necessary,
|
||||
# add ./ to avoid colon confusion.
|
||||
if ($url !~ /^\// && $url !~ /^\.\.\//) {
|
||||
$url="./$url";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue