X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/42ac4ec00959bd6162076af799023545b698bed9..89256ab870299242c2f62858680c4a2870600a14:/IkiWiki/Plugin/recentchanges.pm

diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm
index d534d0cd9..563ab7db1 100644
--- a/IkiWiki/Plugin/recentchanges.pm
+++ b/IkiWiki/Plugin/recentchanges.pm
@@ -4,6 +4,7 @@ package IkiWiki::Plugin::recentchanges;
 use warnings;
 use strict;
 use IkiWiki 2.00;
+use Encode;
 
 sub import { #{{{
 	hook(type => "getsetup", id => "recentchanges", call => \&getsetup);
@@ -16,6 +17,10 @@ sub import { #{{{
 
 sub getsetup () { #{{{
 	return
+		plugin => {
+			safe => 1,
+			rebuild => 1,
+		},
 		recentchangespage => {
 			type => "string",
 			example => "recentchanges",
@@ -82,7 +87,7 @@ sub cgi ($) { #{{{
 		# page they link to is deleted, or newly created, or
 		# changes for whatever reason. So this CGI handles that
 		# dynamic linking stuff.
-		my $page=$cgi->param("page");
+		my $page=decode_utf8($cgi->param("page"));
 		if (!defined $page) {
 			error("missing page parameter");
 		}
@@ -99,7 +104,12 @@ sub cgi ($) { #{{{
 				"</p>");
 		}
 		else {
-			IkiWiki::redirect($cgi, $config{url}.IkiWiki::beautify_urlpath("/".htmlpage($link)));
+			if (defined pagetype($link)) {
+				IkiWiki::redirect($cgi, $config{url}.IkiWiki::beautify_urlpath("/".htmlpage($link)));
+			}
+			else {
+				IkiWiki::redirect($cgi, $config{url}.IkiWiki::beautify_urlpath("/".$link));
+			}
 		}
 
 		exit;