]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/smcvpostcomment.pm
smcvpostcomment: avoid warnings if form field 'body' is undef
[git.ikiwiki.info.git] / IkiWiki / Plugin / smcvpostcomment.pm
index 1255cfde1dcbf32cfda38090a5029e847ff9f6ea..367f2d9b3c56a5fcc881c5acf33208c985ddf711 100644 (file)
@@ -8,6 +8,7 @@ package IkiWiki::Plugin::smcvpostcomment;
 use warnings;
 use strict;
 use IkiWiki 2.00;
 use warnings;
 use strict;
 use IkiWiki 2.00;
+use IkiWiki::Plugin::inline;
 use IkiWiki::Plugin::mdwn;
 use CGI 'escapeHTML';
 
 use IkiWiki::Plugin::mdwn;
 use CGI 'escapeHTML';
 
@@ -188,7 +189,7 @@ sub sessioncgi ($$) { #{{{
 
        my ($authorurl, $author) = linkuser(getcgiuser($session));
 
 
        my ($authorurl, $author) = linkuser(getcgiuser($session));
 
-       my $body = $form->field('body');
+       my $body = $form->field('body') || '';
        $body =~ s/\r\n/\n/g;
        $body =~ s/\r/\n/g;
        $body .= "\n" if $body !~ /\n$/;
        $body =~ s/\r\n/\n/g;
        $body =~ s/\r/\n/g;
        $body .= "\n" if $body !~ /\n$/;
@@ -253,7 +254,7 @@ sub sessioncgi ($$) { #{{{
                my $file;
                do {
                        $i++;
                my $file;
                do {
                        $i++;
-                       $file = "$page/comment_${i}._" . PLUGIN;
+                       $file = "$page/_comment_${i}._" . PLUGIN;
                } while (-e "$config{srcdir}/$file");
 
                # FIXME: could probably do some sort of graceful retry
                } while (-e "$config{srcdir}/$file");
 
                # FIXME: could probably do some sort of graceful retry
@@ -287,7 +288,7 @@ sub sessioncgi ($$) { #{{{
                error($conflict) if defined $conflict;
 
                # Bounce back to where we were, but defeat broken caches
                error($conflict) if defined $conflict;
 
                # Bounce back to where we were, but defeat broken caches
-               my $anticache = "?updated=$page/comment_$i";
+               my $anticache = "?updated=$page/_comment_$i";
                IkiWiki::redirect($cgi, urlto($page, undef, 1).$anticache);
        }
        else {
                IkiWiki::redirect($cgi, urlto($page, undef, 1).$anticache);
        }
        else {