From b6cbb014f67decbd8f8699fa6b5b834a1f9fd16e Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 6 Nov 2018 10:20:38 -0300 Subject: [PATCH] Bug 21770: t::lib::QA::TemplateFilters should allow html_entity in href Bug 21740 highlighted the situation in which the href is not a link (and thus requiring to be URI/URL encoded). This was fixed on the bug, but the xt/find-missing-filters.t tests fail on it, becuase they enforce uri filters on href without exceptions. This patch adds the exception for those href's starting with '#' To test: - Run: $ kshell k$ prove xt/find-missing-filters.t => FAIL: Tests fail - Apply this patch - Run: k$ prove xt/find-missing-filters.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Kyle M Hall --- t/lib/QA/TemplateFilters.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/t/lib/QA/TemplateFilters.pm b/t/lib/QA/TemplateFilters.pm index f2009cc929..b1f444e86d 100644 --- a/t/lib/QA/TemplateFilters.pm +++ b/t/lib/QA/TemplateFilters.pm @@ -70,7 +70,22 @@ sub _process_tt_content { if $line =~ m{\[%(\s|-|~)*USE raw(\s|-|~)*%\]}; # Does [% Use raw %] exist? my $e; - if ( $line =~ qr{(\s|\-|~)*) + (?[^%\-~]+) + (?(\s|\-|~)*) + %\]}gmxs + ) + { + ( $new_line, $e ) = process_tt_block($new_line, { %+, filter => 'html_entity' }); + push @errors, { line => $line, line_number => $line_number, error => $e } if $e; + } + } + elsif ( $line =~ qr{