[Bps-public-commit] rt-extension-formtools branch support-wide-characters created. 1.04-4-gd097967

BPS Git Server git at git.bestpractical.com
Wed Feb 21 22:08:38 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, support-wide-characters has been created
        at  d0979674d68a3806061745870e5c1756e1e0bca9 (commit)

- Log -----------------------------------------------------------------
commit d0979674d68a3806061745870e5c1756e1e0bca9
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;
     }
 }

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


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


More information about the Bps-public-commit mailing list