From: Simon McVittie Date: Thu, 11 Dec 2008 02:03:07 +0000 (+0000) Subject: comments: avoid warning if there's no subject X-Git-Tag: 2.71~102 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fbf145ca3ff18985d0885ed939ee63123add9dbd;p=ikiwiki.git comments: avoid warning if there's no subject --- diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 6bd18a5cf..d1105b366 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -434,8 +434,10 @@ sub sessioncgi ($$) { #{{{ } my $subject = $form->field('subject'); - $subject =~ s/"/"/g; - $content .= " subject=\"$subject\"\n"; + if (length $subject) { + $subject =~ s/"/"/g; + $content .= " subject=\"$subject\"\n"; + } $content .= " date=\"" . IkiWiki::formattime(time, '%X %x') . "\"\n";