[Rt-commit] rt branch, 4.2/clicky-escaping, updated. rt-4.2.13-121-g8ffd68d

Dave Goehrig dave at bestpractical.com
Thu Mar 16 14:36:06 EDT 2017


The branch, 4.2/clicky-escaping has been updated
       via  8ffd68de3d3dd50ef08274a377179172da3a16b4 (commit)
      from  35868782610198b0ea675e476cf5ff8cebcb2b65 (commit)

Summary of changes:
 t/web/make-clicky.t | 7 +++++++
 1 file changed, 7 insertions(+)

- Log -----------------------------------------------------------------
commit 8ffd68de3d3dd50ef08274a377179172da3a16b4
Author: Dave Goehrig <dave at bestpractical.com>
Date:   Thu Mar 16 14:34:25 2017 -0400

    Adding test to check double encoding &
    
    Added a case where the url contains an &
    if the html parameter is set to true, then it
    should not reencode the & to #38amp;.

diff --git a/t/web/make-clicky.t b/t/web/make-clicky.t
index da99d11..43f4249 100644
--- a/t/web/make-clicky.t
+++ b/t/web/make-clicky.t
@@ -68,6 +68,13 @@ diag "Found in other attribute";
     is_string( make_clicky($m, $url, 1), $url, "URL in image src= is a no-op" );
 }
 
+diag "Do not double encode &amp test";
+{
+    my $url = 'http://bestpractical.com/search?q=me&irene;token=foo';
+    my $string = qq[<span class="clickylink"><a target="_blank" href="http://bestpractical.com/search?q=me&irene;token=foo">http://bestpractical.com/search?q=me&irene;token=foo</a></span>];
+    is_string( make_clicky($m,$url, 1), $string, "URL with & should not rencode" );
+
+}
 
 sub make_clicky {
     my $m    = shift;

-----------------------------------------------------------------------


More information about the rt-commit mailing list