comments: avoid warning if there's no subject
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Thu, 11 Dec 2008 02:03:07 +0000 (02:03 +0000)
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Thu, 11 Dec 2008 21:14:05 +0000 (21:14 +0000)
IkiWiki/Plugin/comments.pm

index 6bd18a5cf2be10765a5dbbf5bf83fbd1a88c80bf..d1105b3662ab4b6e96720bc86b9f512e5565f267 100644 (file)
@@ -434,8 +434,10 @@ sub sessioncgi ($$) { #{{{
        }
 
        my $subject = $form->field('subject');
-       $subject =~ s/"/&quot;/g;
-       $content .= " subject=\"$subject\"\n";
+       if (length $subject) {
+               $subject =~ s/"/&quot;/g;
+               $content .= " subject=\"$subject\"\n";
+       }
 
        $content .= " date=\"" . IkiWiki::formattime(time, '%X %x') . "\"\n";