X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/7960031135e74f6d36abc4294dbadb687117222c..5693776ae4f48ee55ea4affa9c060a95dcc4b1be:/IkiWiki/CGI.pm diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 75f096e13..c2dacf78d 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -33,10 +33,9 @@ sub showform ($$$$) { #{{{ buttons => $buttons); }); } - else { - printheader($session); - print misctemplate($form->title, $form->render(submit => $buttons)); - } + + printheader($session); + print misctemplate($form->title, $form->render(submit => $buttons)); } sub redirect ($$) { #{{{ @@ -311,9 +310,6 @@ sub cgi_editpage ($$) { #{{{ fields => \@fields, charset => "utf-8", method => 'POST', - validate => { - editcontent => '/.+/', - }, required => [qw{editcontent}], javascript => 0, params => $q, @@ -357,6 +353,7 @@ sub cgi_editpage ($$) { #{{{ $form->field(name => "rcsinfo", value => rcs_prepedit($file), force => 1); } + $form->field(name => "editcontent", validate => '/.*/'); } else { $type=$form->param('type'); @@ -372,6 +369,7 @@ sub cgi_editpage ($$) { #{{{ if (! $form->submitted) { $form->field(name => "rcsinfo", value => "", force => 1); } + $form->field(name => "editcontent", validate => '/.+/'); } $form->field(name => "do", type => 'hidden'); @@ -553,6 +551,7 @@ sub cgi_editpage ($$) { #{{{ }); $content=~s/\r\n/\n/g; $content=~s/\r/\n/g; + $content.="\n" if $content !~ /\n$/; $config{cgi}=0; # avoid cgi error message eval { writefile($file, $config{srcdir}, $content) };