return $canedit;
} #}}}
+sub decode_cgi_utf8 ($) { #{{{
+ # decode_form_utf8 method is needed for 5.10
+ if ($] < 5.01) {
+ my $cgi = shift;
+ foreach my $f ($cgi->param) {
+ $cgi->param($f, map { decode_utf8 $_ } $cgi->param($f));
+ }
+ }
+} #}}}
+
sub decode_form_utf8 ($) { #{{{
- my $form = shift;
- foreach my $f ($form->field) {
- $form->field(name => $f,
- value => decode_utf8($form->field($f)),
- force => 1,
- );
+ if ($] >= 5.01) {
+ my $form = shift;
+ foreach my $f ($form->field) {
+ $form->field(name => $f,
+ value => decode_utf8($form->field($f)),
+ force => 1,
+ );
+ }
}
} #}}}
my $q=shift;
my $session=shift;
+ decode_cgi_utf8($q);
eval q{use CGI::FormBuilder};
error($@) if $@;
my $form = CGI::FormBuilder->new(
my $session=shift;
needsignin($q, $session);
+ decode_cgi_utf8($q);
# The session id is stored on the form and checked to
# guard against CSRF.
my $q=shift;
my $session=shift;
+ decode_cgi_utf8($q);
+
my @fields=qw(do rcsinfo subpage from page type editcontent comments);
my @buttons=("Save Page", "Preview", "Cancel");
eval q{use CGI::FormBuilder};
);
});
$form->tmpl_param("page_preview",
- htmlize($page, $type,
+ htmlize($page, $page, $type,
linkify($page, $page,
preprocess($page, $page,
filter($page, $page, $content), 0, 1))));
my $q=shift;
eval q{use CGI::Session};
+ error($@) if $@;
CGI::Session->name("ikiwiki_session_".encode_utf8($config{wikiname}));
my $oldmask=umask(077);