[Bps-public-commit] rt-extension-formtools branch master updated. 1.05-5-gbb544f5

BPS Git Server git at git.bestpractical.com
Thu Feb 22 18:46:16 UTC 2024


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt-extension-formtools".

The branch, master has been updated
       via  bb544f55f69eafc1fe2ed61969f7116b98b3283b (commit)
       via  0f0b6e3f57e8aed58d809c4efbf5afc6d6845e48 (commit)
       via  9bb5ca769830e3a5589ba7b8fe9df01c91f04a74 (commit)
       via  b56d56e1c955eaa08ef0c594220d827e1cdf4221 (commit)
       via  f3797653eff7a4bc17d2eab6d213bffd968d3a43 (commit)
      from  6a4e1b3ed74f1202f8531ddf5d298431f288a0f5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bb544f55f69eafc1fe2ed61969f7116b98b3283b
Author: Jason Crome <jcrome at bestpractical.com>
Date:   Thu Feb 22 09:53:04 2024 -0500

    Prep version 1.06

diff --git a/Changes b/Changes
index 98462da..253b386 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for RT-Extension-FormTools
 
+1.06 2024-02-22
+ - Added wide character support
+ - Remove duplicate values of hidden inputs to avoid possible double-encoding of content
+
 1.05 2024-02-21
  - Don't show hidden fields on the ShowChoices summary
  - Group fields on ShowChoices by page in the order they appear
diff --git a/META.yml b/META.yml
index b01075e..e86cc37 100644
--- a/META.yml
+++ b/META.yml
@@ -25,6 +25,6 @@ requires:
 resources:
   license: http://opensource.org/licenses/gpl-license.php
   repository: https://github.com/bestpractical/rt-extension-formtools
-version: '1.05'
+version: '1.06'
 x_module_install_rtx_version: '0.43'
 x_requires_rt: 5.0.0
diff --git a/lib/RT/Extension/FormTools.pm b/lib/RT/Extension/FormTools.pm
index 0a057ed..1b357a4 100644
--- a/lib/RT/Extension/FormTools.pm
+++ b/lib/RT/Extension/FormTools.pm
@@ -3,7 +3,7 @@ use strict;
 
 package RT::Extension::FormTools;
 
-our $VERSION = '1.05';
+our $VERSION = '1.06';
 
 RT->AddStyleSheets('rt-extension-formtools.css');
 RT->AddJavaScript('rt-extension-formtools.js');

commit 0f0b6e3f57e8aed58d809c4efbf5afc6d6845e48
Merge: b56d56e 9bb5ca7
Author: Jason Crome <jcrome at bestpractical.com>
Date:   Thu Feb 22 09:46:23 2024 -0500

    Merge branch 'uniq-hidden-inputs'


commit 9bb5ca769830e3a5589ba7b8fe9df01c91f04a74
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Feb 21 17:23:52 2024 -0500

    Remove duplicate values of hidden inputs
    
    After "Back" and "Next" clicks, hidden inputs might be duplicated, like
    the Content's assistant ContentType input. RT doesn't support duplicate
    ContentType and it could cause double-encoded HTML content and wrong
    Content-Type header of attachments.

diff --git a/html/FormTools/Form b/html/FormTools/Form
index 16d66b9..7c40e8a 100644
--- a/html/FormTools/Form
+++ b/html/FormTools/Form
@@ -140,9 +140,10 @@ $next_for_validation ||= $m->caller(1)->path;
 <%$content|n%>
 
 % if ($enable_persisting) {
+% require List::MoreUtils;
 % foreach my $key (keys %request_args) {
 % next if (ref $request_args{$key} && ref $request_args{$key} ne 'ARRAY');
-% foreach my $val ( ref ($request_args{$key}) ? @{$request_args{$key}} : ($request_args{$key})) {
+% foreach my $val ( ref ($request_args{$key}) ? List::MoreUtils::uniq(@{$request_args{$key}}) : ($request_args{$key})) {
 % next if $forbid_persisting->{$key};
 % next if ($key eq 'user' or $key eq 'pass');
 % next if $key eq 'Submit'; # No need to pass through "Next" button value

commit b56d56e1c955eaa08ef0c594220d827e1cdf4221
Merge: 6a4e1b3 f379765
Author: Jason Crome <jcrome at bestpractical.com>
Date:   Thu Feb 22 09:41:10 2024 -0500

    Merge branch 'support-wide-characters'


commit f3797653eff7a4bc17d2eab6d213bffd968d3a43
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Feb 21 17:02:54 2024 -0500

    Encode arguments of subexec to support wide characters
    
    subexec makes sub requests and RT always decodes arguments from the
    beginning of request handling. Here we encode arguments, exactly the reverse
    of RT::Interface::Web::DecodeARGS.

diff --git a/html/FormTools/Form b/html/FormTools/Form
index f5ca591..16d66b9 100644
--- a/html/FormTools/Form
+++ b/html/FormTools/Form
@@ -74,7 +74,20 @@ if ($real_next) {
 
         $real_next = $m->caller(1)->dir_path . '/' . $real_next
             unless $real_next =~ m'^/';
-        $m->subexec("$real_next", %ARGS, %request_args);
+        $m->subexec(
+            $real_next,
+            map {
+                my $type = ref($_);
+                ( !$type )
+                    ? Encode::encode( 'UTF-8', $_, Encode::FB_PERLQQ )
+                    : ( $type eq 'ARRAY' )
+                    ? [ map { ref($_) ? $_ : Encode::encode( 'UTF-8', $_, Encode::FB_PERLQQ ) } @$_ ]
+                    : ( $type eq 'HASH' )
+                    ? { map { ref($_) ? $_ : Encode::encode( 'UTF-8', $_, Encode::FB_PERLQQ ) } %$_ }
+                    : $_
+
+            } %ARGS, %request_args
+        );
         $m->abort;
     }
 }

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

Summary of changes:
 Changes                       |  4 ++++
 META.yml                      |  2 +-
 html/FormTools/Form           | 18 ++++++++++++++++--
 lib/RT/Extension/FormTools.pm |  2 +-
 4 files changed, 22 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
rt-extension-formtools


More information about the Bps-public-commit mailing list