From 6e0098211da9c1270a019a123b4af5dcb65faac6 Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 12 Mar 2006 20:31:02 +0000 Subject: [PATCH] don't allow saving empty page --- ikiwiki | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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, -- 2.26.2