- # 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 !~ /^\.\.\//) {