From: joey Date: Sun, 12 Mar 2006 20:31:02 +0000 (+0000) Subject: don't allow saving empty page X-Git-Tag: 1.0~399 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6e0098211da9c1270a019a123b4af5dcb65faac6;p=ikiwiki.git don't allow saving empty page --- diff --git a/ikiwiki b/ikiwiki index 0f6f250a0..06627fc29 100755 --- a/ikiwiki +++ b/ikiwiki @@ -720,7 +720,7 @@ sub cgi_recentchanges ($) { #{{{ print $q->header, $template->output; } #}}} -sub userinfo_get ($$) { #{{ +sub userinfo_get ($$) { #{{{ my $user=shift; my $field=shift; @@ -731,9 +731,9 @@ sub userinfo_get ($$) { #{{ return ""; } return $userdata->{$user}->{$field}; -} #}} +} #}}} -sub userinfo_set ($$) { #{{ +sub userinfo_set ($$) { #{{{ my $user=shift; my $info=shift; @@ -747,7 +747,7 @@ sub userinfo_set ($$) { #{{ my $ret=Storable::lock_store($userdata, "$srcdir/.ikiwiki/userdb"); umask($oldmask); return $ret; -} #}} +} #}}} sub cgi_signin ($$) { #{{{ my $q=shift; @@ -916,8 +916,10 @@ sub cgi_editpage ($$) { #{{{ fields => [qw(do from page content comments)], header => 1, method => 'POST', - validate => {}, - required => [qw{}], + validate => { + content => '/.+/', + }, + required => [qw{content}], javascript => 0, params => $q, action => $q->request_uri,