perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: modperl-2.0/t/response/TestModperl post_utf8.pm
Date Mon, 18 Oct 2004 23:21:28 GMT
stas        2004/10/18 16:21:28

  Modified:    t/response/TestModperl post_utf8.pm
  Log:
  workaround for perl-5.8.0, which doesn't decode correctly a tainted
  variable
  
  Revision  Changes    Path
  1.6       +6 -1      modperl-2.0/t/response/TestModperl/post_utf8.pm
  
  Index: post_utf8.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestModperl/post_utf8.pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -u -r1.5 -r1.6
  --- post_utf8.pm	3 Aug 2004 16:16:23 -0000	1.5
  +++ post_utf8.pm	18 Oct 2004 23:21:28 -0000	1.6
  @@ -30,12 +30,17 @@
       # utf encode/decode was added only in 5.8.0
       # XXX: currently binmode is only available with perlio (used on the
       # server side on the tied/perlio STDOUT)
  -    plan $r, tests => 2, 
  +    plan $r, tests => 2,
           need need_min_perl_version(5.008), need_perl('perlio');
   
       my $received = ModPerl::Test::read_post($r) || "";
       # assume that we know that it's utf8
       require Encode; # since 5.8.0
  +
  +    # workaround for perl-5.8.0, which doesn't decode correctly a
  +    # tainted variable
  +    ModPerl::Util::untaint($received) if $] == 5.008;
  +
       $received = Encode::decode('utf8', $received);
       # utf8::decode() doesn't work under -T
       my ($received_ascii, $received_utf8) = split /=/, $received;
  
  
  

Mime
View raw message