]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/CGI.pm
* Ensure that web edited pages always end in a newline.
[ikiwiki.git] / IkiWiki / CGI.pm
index 75f096e137b99e4fccd39fc9c6d290bf9106a1e2..33e670eacbd7291b6cd1a30092b33f9b80e6bd93 100644 (file)
@@ -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 ($$) { #{{{
@@ -553,6 +552,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) };