summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/CGI.pm8
-rw-r--r--IkiWiki/Render.pm5
2 files changed, 9 insertions, 4 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index d069de8dc..b2d126977 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -308,7 +308,8 @@ sub cgi_editpage ($$) { #{{{
# This untaint is safe because titlepage removes any problimatic
# characters.
- my ($page)=titlepage(possibly_foolish_untaint(lc($form->param('page'))));
+ my ($page)=Encode::decode_utf8($form->param('page'));
+ $page=titlepage(possibly_foolish_untaint(lc($page)));
if (! defined $page || ! length $page ||
$page=~/$config{wiki_file_prune_regexp}/ || $page=~/^\//) {
error("bad page name");
@@ -353,10 +354,11 @@ sub cgi_editpage ($$) { #{{{
# utf-8, so decode from it.
require Encode;
my $content = Encode::decode_utf8($form->field('editcontent'));
+ my $comments = Encode::decode_utf8($form->field('comments'));
$form->field(name => "editcontent",
value => $content, force => 1);
$form->field(name => "comments",
- value => Encode::decode_utf8($form->field('comments')), force => 1);
+ value => $comments, force => 1);
$form->tmpl_param("page_preview",
htmlize($config{default_pageext},
linkify($page, $page, $content)));
@@ -457,7 +459,7 @@ sub cgi_editpage ($$) { #{{{
}
if (defined $form->field('comments') &&
length $form->field('comments')) {
- $message.=Encode::decode_utf8(": ".$form->field('comments'));
+ $message.=": ".Encode::decode_utf8($form->field('comments'));
}
if ($config{rcs}) {
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index 3be8e1c53..e778ff20c 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -324,9 +324,11 @@ sub refresh () { #{{{
my %exists;
my @files;
eval q{use File::Find};
+ require Encode;
find({
no_chdir => 1,
wanted => sub {
+ $_ = Encode::decode_utf8($_);
if (/$config{wiki_file_prune_regexp}/) {
$File::Find::prune=1;
}
@@ -346,6 +348,7 @@ sub refresh () { #{{{
find({
no_chdir => 1,
wanted => sub {
+ $_ = Encode::decode_utf8($_);
if (/$config{wiki_file_prune_regexp}/) {
$File::Find::prune=1;
}
@@ -405,7 +408,7 @@ sub refresh () { #{{{
if (! exists $oldpagemtime{$page} ||
mtime(srcfile($file)) > $oldpagemtime{$page}) {
- debug("rendering changed file $file");
+ debug("rendering $file");
render($file);
$rendered{$file}=1;
}