From: Joey Hess Date: Tue, 8 Jul 2008 14:03:55 +0000 (-0400) Subject: Fix a bug with links to pages whose names contained colons. X-Git-Tag: 2.53~54 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e25c3a0a7caa9783c657efe86611929ecb7bd4a3;p=ikiwiki.git Fix a bug with links to pages whose names contained colons. 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. --- diff --git a/IkiWiki.pm b/IkiWiki.pm index 0b420e824..5a05a0f73 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -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; } #}}} diff --git a/debian/changelog b/debian/changelog index 8cd0084f9..eee1a01b9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Mon, 07 Jul 2008 01:52:48 -0400