Bugzilla – Attachment 82008 Details for
Bug 21770
t::lib::QA::TemplateFilters should allow html_entity in href
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21770: t::lib::QA::TemplateFilters should allow html_entity in href
Bug-21770-tlibQATemplateFilters-should-allow-htmle.patch (text/plain), 2.15 KB, created by
Kyle M Hall (khall)
on 2018-11-06 20:31:43 UTC
(
hide
)
Description:
Bug 21770: t::lib::QA::TemplateFilters should allow html_entity in href
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-11-06 20:31:43 UTC
Size:
2.15 KB
patch
obsolete
>From b6cbb014f67decbd8f8699fa6b5b834a1f9fd16e Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >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 <kyle@bywatersolutions.com> >--- > 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{<a href="([^"]+)} ) { >+ if ( $line =~ qr{<a href="#.*([^"]+)} ) { # it's an href, but tagetting JavaScript usage (like bootstrap) >+ my $to_uri_escape = $1; >+ while ( >+ $to_uri_escape =~ m{ >+ \[% >+ (?<pre_chomp>(\s|\-|~)*) >+ (?<tt_block>[^%\-~]+) >+ (?<post_chomp>(\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{<a href="([^"]+)} ) { > my $to_uri_escape = $1; > while ( > $to_uri_escape =~ m{ >-- >2.17.2 (Apple Git-113)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21770
:
81980
|
81983
|
81984
|
82008
|
82009
|
82010
|
82041
|
82042