goto: Support being passed a page title that is not a valid page name, to support...
authorJoey Hess <joey@gnu.kitenet.net>
Sat, 6 Jun 2009 06:36:40 +0000 (02:36 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Sat, 6 Jun 2009 06:36:40 +0000 (02:36 -0400)
IkiWiki/Plugin/goto.pm
debian/changelog
doc/bugs/goto_with_bad_page_name.mdwn

index 3f40c5859f3d22f7d7c1fc7dfb8d9398e8a7249f..2e2dc04a111a164745fb628785b509d40e024e6c 100644 (file)
@@ -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
index df4429326c7a0b64f4e97090ddff60d6ae23fff6..7f82578130ff93b632f4a2a4ca3b6f94097f6ff8 100644 (file)
@@ -14,6 +14,10 @@ ikiwiki (3.15) UNRELEASED; urgency=low
     fails for any reason, disable it in the generated file.
     Closes: 532001
   * pagecount: Fix broken optimisation for * pagespec.
+  * 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.
 
  -- Joey Hess <joeyh@debian.org>  Tue, 02 Jun 2009 17:03:41 -0400
 
index 722c4e266207fc9af323bfc672e69d17bd7f27df..bc462c8400636902cd6dd926789a4527c78e8793 100644 (file)
@@ -20,4 +20,6 @@ pass it through titlepage if not.
 with spaces" to "http://wiki/some_page_with_spaces", if the latter exists.
 That seems like a fairly good thing.)
 
+[[done]]
+
 --[[Joey]]