]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
viewvcs: HTML fixes for commits
authorEric Wong <e@80x24.org>
Mon, 12 Feb 2024 13:13:50 +0000 (13:13 +0000)
committerEric Wong <e@80x24.org>
Tue, 13 Feb 2024 07:32:40 +0000 (07:32 +0000)
The "patch is too large to show" text is now broken by an <hr>
to prevent it from being confused as part of a commit message
(or having somebody intentionally insert that text in a commit
message to confuse readers).  A missing </pre> is also necessary
before the <hr> tag for the related commit search form.

lib/PublicInbox/ViewVCS.pm

index 2a305303d30096cfd4bfd080bb86e8273409091f..61329db6c21dc18850666657eaaff2f48d7864d4 100644 (file)
@@ -274,7 +274,7 @@ EOM
        undef $bdy; # free memory
        my $fh = delete $ctx->{patch_fh};
        if (-s $fh > $MAX_SIZE) {
-               print $zfh "---\n patch is too large to show\n";
+               print $zfh '</pre><hr><pre>patch is too large to show</pre>';
        } else { # prepare flush_diff:
                seek $fh, 0, SEEK_SET;
                PublicInbox::IO::read_all $fh, -s _, \$x;
@@ -312,7 +312,7 @@ EOM
                                $alt = '';
                        }
                        print $zfh <<EOM;
-<hr><form action="$ibx_url"
+</pre><hr><form action="$ibx_url"
 id=related><pre>find related emails, including ancestors/descendants/conflicts
 <textarea name=q cols=${\PublicInbox::View::COLS} rows=$rows>$q</textarea>
 <input type=submit value="search$alt"