]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Revert "Revert "Fix a bug with links to pages whose names contained colons.""
authorJoey Hess <joey@kodama.kitenet.net>
Fri, 11 Jul 2008 14:31:08 +0000 (10:31 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Fri, 11 Jul 2008 14:31:08 +0000 (10:31 -0400)
This reverts commit 810a355308d276ef922ff4312bff0c7935676633.

I double-checked, and the change seems ok after all, actually.

IkiWiki.pm

index 4368870b837f26d4f9ee9891b1dcfd717a8a35a7..6e03121c078242c9ef35d2d050224b7f3d79c3ff 100644 (file)
@@ -539,7 +539,12 @@ sub beautify_url ($) { #{{{
        if ($config{usedirs}) {
                $url =~ s!/index.$config{htmlext}$!/!;
        }
-       $url =~ s!^$!./!; # Browsers don't like empty links...
+
+       # Ensure url is not an empty link, and
+       # if it's relative, make that explicit to avoid colon confusion.
+       if ($url !~ /\//) {
+               $url="./$url";
+       }
 
        return $url;
 } #}}}