r67724 - in /branches/upstream/liburi-perl/current: Changes META.yml URI.pm URI/_query.pm t/old-base.t t/query.t

angelabad-guest at users.alioth.debian.org angelabad-guest at users.alioth.debian.org
Sun Jan 23 11:24:06 UTC 2011


Author: angelabad-guest
Date: Sun Jan 23 11:23:46 2011
New Revision: 67724

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=67724
Log:
[svn-upgrade] new version liburi-perl (1.58)

Modified:
    branches/upstream/liburi-perl/current/Changes
    branches/upstream/liburi-perl/current/META.yml
    branches/upstream/liburi-perl/current/URI.pm
    branches/upstream/liburi-perl/current/URI/_query.pm
    branches/upstream/liburi-perl/current/t/old-base.t
    branches/upstream/liburi-perl/current/t/query.t

Modified: branches/upstream/liburi-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liburi-perl/current/Changes?rev=67724&op=diff
==============================================================================
--- branches/upstream/liburi-perl/current/Changes (original)
+++ branches/upstream/liburi-perl/current/Changes Sun Jan 23 11:23:46 2011
@@ -1,3 +1,12 @@
+2011-01-23   Gisle Aas <gisle at ActiveState.com>
+
+  Release 1.58
+
+  This release reverts the patch in 1.57 that made query_form distingush
+  between empty and undef values.  It broke stuff. [RT#62708]
+
+
+
 2011-01-22   Gisle Aas <gisle at ActiveState.com>
 
   Release 1.57

Modified: branches/upstream/liburi-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liburi-perl/current/META.yml?rev=67724&op=diff
==============================================================================
--- branches/upstream/liburi-perl/current/META.yml (original)
+++ branches/upstream/liburi-perl/current/META.yml Sun Jan 23 11:23:46 2011
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               URI
-version:            1.57
+version:            1.58
 abstract:           Uniform Resource Identifiers (absolute and relative)
 author:
     - Gisle Aas <gisle at activestate.com>

Modified: branches/upstream/liburi-perl/current/URI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liburi-perl/current/URI.pm?rev=67724&op=diff
==============================================================================
--- branches/upstream/liburi-perl/current/URI.pm (original)
+++ branches/upstream/liburi-perl/current/URI.pm Sun Jan 23 11:23:46 2011
@@ -2,7 +2,7 @@
 
 use strict;
 use vars qw($VERSION);
-$VERSION = "1.57";
+$VERSION = "1.58";
 
 use vars qw($ABS_REMOTE_LEADING_DOTS $ABS_ALLOW_RELATIVE_SCHEME $DEFAULT_QUERY_FORM_DELIMITER);
 

Modified: branches/upstream/liburi-perl/current/URI/_query.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liburi-perl/current/URI/_query.pm?rev=67724&op=diff
==============================================================================
--- branches/upstream/liburi-perl/current/URI/_query.pm (original)
+++ branches/upstream/liburi-perl/current/URI/_query.pm Sun Jan 23 11:23:46 2011
@@ -46,14 +46,10 @@
 	    $key =~ s/ /+/g;
 	    $vals = [ref($vals) eq "ARRAY" ? @$vals : $vals];
             for my $val (@$vals) {
-                if (defined $val) {
-		    $val =~ s/([;\/?:@&=+,\$\[\]%])/ URI::Escape::escape_char($1)/eg;
-		    $val =~ s/ /+/g;
-		    push(@query, "$key=$val");
-		}
-                else {
-                    push(@query, $key);
-                }
+                $val = '' unless defined $val;
+		$val =~ s/([;\/?:@&=+,\$\[\]%])/ URI::Escape::escape_char($1)/eg;
+                $val =~ s/ /+/g;
+                push(@query, "$key=$val");
             }
         }
         if (@query) {
@@ -68,8 +64,9 @@
         }
     }
     return if !defined($old) || !length($old) || !defined(wantarray);
-    map { defined($_) ? do { s/\+/ /g; uri_unescape($_) } : undef }
-         map { /=/ ? split(/=/, $_, 2) : ($_ => undef)} split(/[&;]/, $old);
+    return unless $old =~ /=/; # not a form
+    map { s/\+/ /g; uri_unescape($_) }
+         map { /=/ ? split(/=/, $_, 2) : ($_ => '')} split(/[&;]/, $old);
 }
 
 # Handle ...?dog+bones type of query

Modified: branches/upstream/liburi-perl/current/t/old-base.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liburi-perl/current/t/old-base.t?rev=67724&op=diff
==============================================================================
--- branches/upstream/liburi-perl/current/t/old-base.t (original)
+++ branches/upstream/liburi-perl/current/t/old-base.t Sun Jan 23 11:23:46 2011
@@ -346,7 +346,7 @@
     die "\$url->query_form did not work"
       unless $a{a} eq 'foo' && $a{b} eq 'bar';
 
-    $url->query_form(a => '', a => 'foo', '&=' => '&=+');
+    $url->query_form(a => undef, a => 'foo', '&=' => '&=+');
     $url->_expect('as_string' => 'http://web?a=&a=foo&%26%3D=%26%3D%2B');
 
     my @a = $url->query_form;

Modified: branches/upstream/liburi-perl/current/t/query.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/liburi-perl/current/t/query.t?rev=67724&op=diff
==============================================================================
--- branches/upstream/liburi-perl/current/t/query.t (original)
+++ branches/upstream/liburi-perl/current/t/query.t Sun Jan 23 11:23:46 2011
@@ -1,7 +1,7 @@
 #!perl -w
 
 use strict;
-use Test::More tests => 26;
+use Test::More tests => 23;
 
 use URI ();
 my $u = URI->new("", "http");
@@ -11,12 +11,7 @@
 is $u, "?a=3&b=4";
 
 $u->query_form(a => undef);
-is $u, "?a";
-is_deeply [$u->query_form], [a => undef];
-
-$u->query_form(a => '');
 is $u, "?a=";
-is_deeply [$u->query_form], [a => ''];
 
 $u->query_form("a[=&+#] " => " [=&+#]");
 is $u, "?a%5B%3D%26%2B%23%5D+=+%5B%3D%26%2B%23%5D";
@@ -37,7 +32,7 @@
 is join(":", @q), " :+:=:[:]";
 
 @q = $u->query_form;
-is_deeply \@q, ['  + = [ ]', undef];
+ok !@q;
 
 $u->query(" +?=#");
 is $u, "?%20+?=%23";




More information about the Pkg-perl-cvs-commits mailing list