diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-07-06 17:35:50 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-07-06 17:35:50 -0400 |
commit | 788c1e9eca84093b01d312e4d9f8e736ecc61ea9 (patch) | |
tree | b1e8bf27b95e297e7aab9b7720d95aa5ea639e60 /IkiWiki | |
parent | 17fdb8028bfb2722c120b229c2131598affbddd6 (diff) | |
download | ikiwiki-788c1e9eca84093b01d312e4d9f8e736ecc61ea9.tar ikiwiki-788c1e9eca84093b01d312e4d9f8e736ecc61ea9.tar.gz |
avoid uninitialised value warnings
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/attachment.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 3bbe27b1a..2bb86b78d 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -20,7 +20,7 @@ sub formbuilder_setup (@) { #{{{ my $form=$params{form}; my $q=$params{cgi}; - if ($form->field("do") eq "edit") { + if (defined $form->field("do") && $form->field("do") eq "edit") { $form->field(name => 'attachment', type => 'file'); # These buttons are not put in the usual place, so # are not added to the normal formbuilder button list. @@ -76,7 +76,7 @@ sub formbuilder (@) { #{{{ my $form=$params{form}; my $q=$params{cgi}; - return if $form->field("do") ne "edit"; + return if ! defined $form->field("do") || $form->field("do") ne "edit"; my $filename=$q->param('attachment'); if (defined $filename && length $filename && |