From e40d2a6b2b1bdf677f11cc4a71595acf609d1e75 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 6 Jun 2009 02:36:40 -0400 Subject: goto: Support being passed a page title that is not a valid page name, to support several cases including mercurial's long user names on the RecentChanges page, and urls with spaces being handled by the 404 plugin. --- IkiWiki/Plugin/goto.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/goto.pm b/IkiWiki/Plugin/goto.pm index 3f40c5859..2e2dc04a1 100644 --- a/IkiWiki/Plugin/goto.pm +++ b/IkiWiki/Plugin/goto.pm @@ -32,6 +32,12 @@ sub cgi_goto ($;$) { } } + # It's possible that $page is not a valid page name; + # if so attempt to turn it into one. + if ($page !~ /$config{wiki_file_regexp}/) { + $page=titlepage($page); + } + IkiWiki::loadindex(); # If the page is internal (like a comment), see if it has a -- cgit v1.2.3