From 444888911b52c0585c661da0875ce938726b7e92 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 6 Feb 2024 11:36:22 +0100 Subject: [PATCH] Bug 34478: Shorten output of xt/find-missing-csrf.t To make it more readable. Signed-off-by: Jonathan Druart --- xt/find-missing-csrf.t | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/xt/find-missing-csrf.t b/xt/find-missing-csrf.t index 02692bcd6f..77820e6e76 100755 --- a/xt/find-missing-csrf.t +++ b/xt/find-missing-csrf.t @@ -53,10 +53,10 @@ find({ wanted => \&wanted, no_chdir => 1 }, @themes ); my @errors; for my $file ( @files ) { my @e = check_csrf_in_forms($file); - push @errors, { file => $file, errors => \@e } if @e; + push @errors, sprintf "%s:%s", $file, join (",", @e) if @e; } -is( @errors, 0, "Template variables should be correctly escaped" ) +is( @errors, 0, "The
in the following files are missing it's corresponding csrf_token include (see bug 22990)" ) or diag(Dumper @errors); sub check_csrf_in_forms { @@ -72,9 +72,7 @@ sub check_csrf_in_forms { $open = $line_number if $line =~ m{ starting on line $open is missing it's corresponding csrf_token include (see bug 22990)" - if !$found; + push @errors, $open unless $found; $found = 0; undef $open; } -- 2.39.5