X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/f6f25758a83c20d4fd17aed7602d8828c59903b7..0f8ea7ecca27a9e73af5c515f637f543912c7076:/IkiWiki/CGI.pm diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 532f9c5f6..0d010b115 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -6,6 +6,8 @@ use IkiWiki; use IkiWiki::UserInfo; use open qw{:utf8 :std}; use Encode; +use CGI; +$CGI::DISABLE_UPLOADS=1; package IkiWiki; @@ -281,7 +283,6 @@ sub cgi_editpage ($$) { #{{{ eval q{use CGI::FormBuilder}; error($@) if $@; my $form = CGI::FormBuilder->new( - title => "editpage", fields => \@fields, charset => "utf-8", method => 'POST', @@ -396,11 +397,17 @@ sub cgi_editpage ($$) { #{{{ session => $session, ); }); - $form->tmpl_param("page_preview", - htmlize($page, $type, + my $preview=htmlize($page, $page, $type, linkify($page, $page, preprocess($page, $page, - filter($page, $page, $content), 0, 1)))); + filter($page, $page, $content), 0, 1))); + run_hooks(format => sub { + $preview=shift->( + page => $page, + content => $preview, + ); + }); + $form->tmpl_param("page_preview", $preview); if ($new) { delete $pagesources{$page}; @@ -662,9 +669,6 @@ sub cgi (;$$) { #{{{ my $session=shift; if (! $q) { - eval q{use CGI}; - error($@) if $@; - binmode(STDIN); $q=CGI->new; binmode(STDIN, ":utf8");