From: Joey Hess Date: Tue, 26 Aug 2008 16:39:02 +0000 (-0400) Subject: Really fix bug with links to pages with names containing colons X-Git-Tag: 2.53.1~14 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/a584b547e2d0dc40d90579a803221c1b9dd61fad Really fix bug with links to pages with names containing colons Previous fix mised a few cases. (cherry picked from commit c2ffd205f3301a9fe6b5949a88da770899642589) --- diff --git a/IkiWiki.pm b/IkiWiki.pm index 4de8f71d6..0b576b32f 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -541,7 +541,7 @@ sub beautify_url ($) { #{{{ # Ensure url is not an empty link, and # if it's relative, make that explicit to avoid colon confusion. - if ($url !~ /\//) { + if ($url !~ /^\//) { $url="./$url"; } diff --git a/debian/changelog b/debian/changelog index 16f32863d..aff2ed774 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,5 @@ -ikiwiki (2.54) UNRELEASED; urgency=low +ikiwiki (2.53.1) UNRELEASED; urgency=low - * Fix uninitialised value warning from a [[!foo]] preprocessor directive - with no whitespace. * ikiwiki-transition: Fix command-line processing so the prefix_directives transition works again. * Fixes creation of pages when clicking on WikiLinks starting with "/". @@ -17,6 +15,8 @@ ikiwiki (2.54) UNRELEASED; urgency=low (Rebuilding the wiki on upgrade to this version is recommended if you use the search plugin.) * meta: fix title() PageSpec + * Really fix bug with links to pages with names containing colons. + Previous fix mised a few cases. -- Josh Triplett Wed, 09 Jul 2008 21:30:33 -0700 diff --git a/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn b/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn deleted file mode 100644 index ac6d6db1e..000000000 --- a/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn +++ /dev/null @@ -1,25 +0,0 @@ -Since upgrading from Ikiwiki 2.20 to 2.32.3 (from Debian Lenny), I don't get hyperlinks to items which have a colon in their name anymore. This applies to both the normal and the archive view. Before the update, the links have been created as relative links, so they weren't usable either as the browser tried to take the part before the colon as protocol specification (as in e.g. `http:`). Iirc, this applied to the archive view only, links in the normal view were ok (will check this out again if it's important). Is there a way to quote each colon as %xy in the hyperlinks? Perhaps it's only a problem with my config, and not an actual bug...? - -EDIT: I just found that in this wiki under the entry "mailto: links not properly generated in rss/atom feeds" also doesn't have a hyperlink - at least it's not a problem with my config only ;-) - -[[madduck]]: I traced this down to `htmlscrubber`. If disabled, it works. If -enabled, then `$safe_url_regexp` determines the URL unsafe because of the -colon and hence removes the `src` attribute. - -Digging into this, I find that [[rfc 3986]] pretty much discourages colons in -filenames: - -> A path segment that contains a colon character (e.g., "this:that") cannot be -> used as the first segment of a relative-path reference, as it would be -> mistaken for a scheme name. Such a segment must be preceded by -> a dot-segment (e.g., "./this:that") to make a relative- path reference. - -The solution seems not to use colons. - -In any case, `htmlscrubber` should get a new regexp, courtesy of dato: -`[^:]+($|\/)`. I have tested and verified this. - -[Commit/patch -be0b4f60](http://git.madduck.net/v/code/ikiwiki.git?a=commit;h=be0b4f603f918444b906e42825908ddac78b7073) fixes this. - -[[done]]