fix uninitialized value warnings

I suspect these are only triggered by spammers.
master
Joey Hess 2009-01-22 20:58:49 -05:00
parent 6fb0ab580e
commit e1ff06b634
1 changed files with 3 additions and 3 deletions

View File

@ -406,19 +406,19 @@ sub sessioncgi ($$) {
if ($config{comments_allowauthor}) { if ($config{comments_allowauthor}) {
my $author = $form->field('author'); my $author = $form->field('author');
if (length $author) { if (defined $author && length $author) {
$author =~ s/"/"/g; $author =~ s/"/"/g;
$content .= " claimedauthor=\"$author\"\n"; $content .= " claimedauthor=\"$author\"\n";
} }
my $url = $form->field('url'); my $url = $form->field('url');
if (length $url) { if (defined $url && length $url) {
$url =~ s/"/"/g; $url =~ s/"/"/g;
$content .= " url=\"$url\"\n"; $content .= " url=\"$url\"\n";
} }
} }
my $subject = $form->field('subject'); my $subject = $form->field('subject');
if (length $subject) { if (defined $subject && length $subject) {
$subject =~ s/"/"/g; $subject =~ s/"/"/g;
$content .= " subject=\"$subject\"\n"; $content .= " subject=\"$subject\"\n";
} }