]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Fix a bug with links to pages whose names contained colons.
authorJoey Hess <joey@kodama.kitenet.net>
Tue, 8 Jul 2008 14:03:55 +0000 (10:03 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Tue, 8 Jul 2008 14:03:55 +0000 (10:03 -0400)
So the problem is that ikiwiki would generate a relative link like
href="colon:problem", which web browsers treat as being in the "colon:"
uri scheme.

The best fix seems to be to make url beautification fix this, by slapping
a "./" in front.

IkiWiki.pm
debian/changelog

index 0b420e824975172b7a72ea6484f81c323cbde14e..5a05a0f73ddf68e8bb624ac7ca74d2965dab9277 100644 (file)
@@ -538,7 +538,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;
 } #}}}
index 8cd0084f9ac73b508dd47fd66b0596c294a625a3..eee1a01b915cf98d81761834c842c26040b3bcfc 100644 (file)
@@ -4,6 +4,7 @@ ikiwiki (2.53) UNRELEASED; urgency=low
     (Gabriel McManus)
   * attachment: Fix an uninitialised value warning when editing a page
     that currently has no attachments.
+  * Fix a bug with links to pages whose names contained colons.
 
  -- Joey Hess <joeyh@debian.org>  Mon, 07 Jul 2008 01:52:48 -0400