From: Joey Hess Date: Fri, 23 Jan 2009 01:58:49 +0000 (-0500) Subject: fix uninitialized value warnings X-Git-Tag: 3.03~46 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e1ff06b634afe790fe7661898bb20d7077d93588;p=ikiwiki.git fix uninitialized value warnings I suspect these are only triggered by spammers. --- diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 833bedf25..6d0e45a97 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -406,19 +406,19 @@ sub sessioncgi ($$) { if ($config{comments_allowauthor}) { my $author = $form->field('author'); - if (length $author) { + if (defined $author && length $author) { $author =~ s/"/"/g; $content .= " claimedauthor=\"$author\"\n"; } my $url = $form->field('url'); - if (length $url) { + if (defined $url && length $url) { $url =~ s/"/"/g; $content .= " url=\"$url\"\n"; } } my $subject = $form->field('subject'); - if (length $subject) { + if (defined $subject && length $subject) { $subject =~ s/"/"/g; $content .= " subject=\"$subject\"\n"; }