]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/CGI.pm
* Allow editing a page and deleting all content, while still disallowing
[ikiwiki.git] / IkiWiki / CGI.pm
index 33e670eacbd7291b6cd1a30092b33f9b80e6bd93..c2dacf78d46253a74015cd67155bbb33fc34ad70 100644 (file)
@@ -310,9 +310,6 @@ sub cgi_editpage ($$) { #{{{
                fields => \@fields,
                charset => "utf-8",
                method => 'POST',
                fields => \@fields,
                charset => "utf-8",
                method => 'POST',
-               validate => {
-                       editcontent => '/.+/',
-               },
                required => [qw{editcontent}],
                javascript => 0,
                params => $q,
                required => [qw{editcontent}],
                javascript => 0,
                params => $q,
@@ -356,6 +353,7 @@ sub cgi_editpage ($$) { #{{{
                        $form->field(name => "rcsinfo",
                                value => rcs_prepedit($file), force => 1);
                }
                        $form->field(name => "rcsinfo",
                                value => rcs_prepedit($file), force => 1);
                }
+               $form->field(name => "editcontent", validate => '/.*/');
        }
        else {
                $type=$form->param('type');
        }
        else {
                $type=$form->param('type');
@@ -371,6 +369,7 @@ sub cgi_editpage ($$) { #{{{
                if (! $form->submitted) {
                        $form->field(name => "rcsinfo", value => "", force => 1);
                }
                if (! $form->submitted) {
                        $form->field(name => "rcsinfo", value => "", force => 1);
                }
+               $form->field(name => "editcontent", validate => '/.+/');
        }
 
        $form->field(name => "do", type => 'hidden');
        }
 
        $form->field(name => "do", type => 'hidden');