Permalink
Browse files

Fix RT#59274 - courtesy of a stupid 5.8.[12] join bug

  • Loading branch information...
ribasushi authored and gisle committed Jan 21, 2012
1 parent 3e60a78 commit 915349ca676bfe99cc6788e2d75858b31a4fd1b6
Showing with 9 additions and 0 deletions.
  1. +9 −0 URI/_idna.pm
View
@@ -7,6 +7,13 @@ use strict;
use URI::_punycode qw(encode_punycode decode_punycode);
use Carp qw(croak);
+BEGIN {
+ *URI::_idna::_ENV_::JOIN_LEAKS_UTF8_FLAGS = $] < 5.008_003
+ ? sub () { 1 }
+ : sub () { 0 }
+ ;
+}
+
my $ASCII = qr/^[\x00-\x7F]*\z/;
sub encode {
@@ -17,6 +24,8 @@ sub encode {
for (@labels) {
$_ = ToASCII($_);
}
+
+ return eval 'join(".", @labels, @last_empty)' if URI::_idna::_ENV_::JOIN_LEAKS_UTF8_FLAGS;
return join(".", @labels, @last_empty);
}

2 comments on commit 915349c

Member

ribasushi replied Mar 17, 2012

Any word of this sailing to CPAN? Are there outstanding RTs you need help triaging? I don't mind giving a hand if pointed to a haystack full of needles ;)

Owner

gisle replied Mar 25, 2012

I delayed it while thinking about "Make query_form() encoded "\n" as "%0D%0A" for HTML/4.01 compliance", but ended up reverting that change. So, now I've uploaded URI-1.60 with this change.

The URI dist does have quite a few outstanding issues , so doing a pass over the RTs would always be helpful.

Please sign in to comment.