r74189 - in /branches/squeeze/libmojolicious-perl: lib/Mojo/Path.pm lib/Mojolicious/Plugin/TagHelpers.pm t/mojo/path.t t/mojo/url.t t/mojox/routes/routes.t

carnil at users.alioth.debian.org carnil at users.alioth.debian.org
Wed May 11 06:13:21 UTC 2011


Author: carnil
Date: Wed May 11 06:12:33 2011
New Revision: 74189

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=74189
Log:
unapplying patches

Modified:
    branches/squeeze/libmojolicious-perl/lib/Mojo/Path.pm
    branches/squeeze/libmojolicious-perl/lib/Mojolicious/Plugin/TagHelpers.pm
    branches/squeeze/libmojolicious-perl/t/mojo/path.t
    branches/squeeze/libmojolicious-perl/t/mojo/url.t
    branches/squeeze/libmojolicious-perl/t/mojox/routes/routes.t

Modified: branches/squeeze/libmojolicious-perl/lib/Mojo/Path.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/squeeze/libmojolicious-perl/lib/Mojo/Path.pm?rev=74189&op=diff
==============================================================================
--- branches/squeeze/libmojolicious-perl/lib/Mojo/Path.pm (original)
+++ branches/squeeze/libmojolicious-perl/lib/Mojo/Path.pm Wed May 11 06:12:33 2011
@@ -85,21 +85,15 @@
     $self->leading_slash(1)  if $path =~ /^\//;
     $self->trailing_slash(1) if $path =~ /\/$/;
 
-    # Unescape
-    $path = b($path)->url_unescape($Mojo::URL::PCHAR)->to_string;
-
     # Parse
     my @parts;
     for my $part (split '/', $path) {
 
-        # Empty parts before the first are garbage
-        next unless length $part or scalar @parts;
-
-        # Empty parts behind the first are ok
-        $part = '' unless defined $part;
+        # Garbage
+        next unless length $part;
 
         # Store
-        push @parts, $part;
+        push @parts, b($part)->url_unescape($Mojo::URL::PCHAR)->to_string;
     }
 
     $self->parts(\@parts);

Modified: branches/squeeze/libmojolicious-perl/lib/Mojolicious/Plugin/TagHelpers.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/squeeze/libmojolicious-perl/lib/Mojolicious/Plugin/TagHelpers.pm?rev=74189&op=diff
==============================================================================
--- branches/squeeze/libmojolicious-perl/lib/Mojolicious/Plugin/TagHelpers.pm (original)
+++ branches/squeeze/libmojolicious-perl/lib/Mojolicious/Plugin/TagHelpers.pm Wed May 11 06:12:33 2011
@@ -73,7 +73,7 @@
             my $captures = ref $_[0] eq 'HASH' ? shift : {};
 
             # Default content
-            push @_, sub { $name = Mojo::ByteStream->new($name)->xml_escape->to_string; ucfirst $name }
+            push @_, sub { ucfirst $name }
               unless defined $_[-1] && ref $_[-1] eq 'CODE';
 
             $self->_tag('a', href => $c->url_for($name, $captures), @_);
@@ -119,7 +119,6 @@
     my %attrs = @_;
     for my $key (sort keys %attrs) {
         my $value = $attrs{$key};
-        $value = Mojo::ByteStream->new($value)->xml_escape->to_string;
         $tag .= qq/ $key="$value"/;
     }
 

Modified: branches/squeeze/libmojolicious-perl/t/mojo/path.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/squeeze/libmojolicious-perl/t/mojo/path.t?rev=74189&op=diff
==============================================================================
--- branches/squeeze/libmojolicious-perl/t/mojo/path.t (original)
+++ branches/squeeze/libmojolicious-perl/t/mojo/path.t Wed May 11 06:12:33 2011
@@ -5,7 +5,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 11;
+use Test::More tests => 3;
 
 # This is the greatest case of false advertising I’ve seen since I sued the
 # movie “The Never Ending Story.”
@@ -14,18 +14,3 @@
 my $path = Mojo::Path->new;
 is($path->parse('/path')->to_string,   '/path',   'right path');
 is($path->parse('/path/0')->to_string, '/path/0', 'right path');
-
-# Canonicalizing
-$path = Mojo::Path->new(
-  '/%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fetc%2fpasswd');
-is "$path", '/../../../../../../../../../../etc/passwd', 'rigth result';
-is $path->parts->[0], '..', 'right part';
-is $path->canonicalize, '/../../../../../../../../../../etc/passwd',
-  'rigth result';
-is $path->parts->[0], '..', 'right part';
-$path = Mojo::Path->new(
-  '/%2ftest%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fetc%2fpasswd');
-is "$path", '/test/../../../../../../../../../etc/passwd', 'rigth result';
-is $path->parts->[0], 'test', 'right part';
-is $path->canonicalize, '/../../../../../../../../etc/passwd', 'rigth result';
-is $path->parts->[0], '..', 'right part';

Modified: branches/squeeze/libmojolicious-perl/t/mojo/url.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/squeeze/libmojolicious-perl/t/mojo/url.t?rev=74189&op=diff
==============================================================================
--- branches/squeeze/libmojolicious-perl/t/mojo/url.t (original)
+++ branches/squeeze/libmojolicious-perl/t/mojo/url.t Wed May 11 06:12:33 2011
@@ -7,7 +7,7 @@
 
 use utf8;
 
-use Test::More tests => 117;
+use Test::More tests => 111;
 
 use Mojo::ByteStream 'b';
 
@@ -121,12 +121,12 @@
 is($url->userinfo, undef,                                     'no userinfo');
 is($url->host,     'acme.s3.amazonaws.com',                   'right host');
 is($url->port,     undef,                                     'no port');
-is($url->path,     '/mojo/g++-4.2_4.2.3-2ubuntu7_i386.deb', 'right path');
+is($url->path,     '/mojo%2Fg++-4.2_4.2.3-2ubuntu7_i386.deb', 'right path');
 ok(!$url->query, 'no query');
 is_deeply($url->query->to_hash, {}, 'right structure');
 is($url->fragment, undef, 'no fragment');
 is("$url",
-    'http://acme.s3.amazonaws.com/mojo/g++-4.2_4.2.3-2ubuntu7_i386.deb',
+    'http://acme.s3.amazonaws.com/mojo%2Fg++-4.2_4.2.3-2ubuntu7_i386.deb',
     'right format');
 
 # Clone (advanced)
@@ -236,17 +236,3 @@
       . '%D1%88%D0%B0%D1%80%D0%B8%D1%84%D1%83%D0%BB%D0%B8%D0%BD',
     'right format'
 );
-
-# Empty path elements
-$url = Mojo::URL->new('http://kraih.com/foo//bar/23/');
-$url->base->parse('http://kraih.com/');
-is($url->is_abs, 1);
-is($url->to_rel, '/foo//bar/23/');
-$url = Mojo::URL->new('http://kraih.com//foo//bar/23/');
-$url->base->parse('http://kraih.com/');
-is($url->is_abs, 1);
-is($url->to_rel, '/foo//bar/23/');
-$url = Mojo::URL->new('http://kraih.com/foo///bar/23/');
-$url->base->parse('http://kraih.com/');
-is($url->is_abs, 1);
-is($url->to_rel, '/foo///bar/23/');

Modified: branches/squeeze/libmojolicious-perl/t/mojox/routes/routes.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/squeeze/libmojolicious-perl/t/mojox/routes/routes.t?rev=74189&op=diff
==============================================================================
--- branches/squeeze/libmojolicious-perl/t/mojox/routes/routes.t (original)
+++ branches/squeeze/libmojolicious-perl/t/mojox/routes/routes.t Wed May 11 06:12:33 2011
@@ -347,8 +347,8 @@
 $m = MojoX::Routes::Match->new($tx)->match($r);
 is($m->stack->[0]->{controller}, 'wild');
 is($m->stack->[0]->{action},     'card');
-is($m->stack->[0]->{wildcard},   'http://www.google.com');
-is($m->url_for,                  '/wildcards/1/http://www.google.com');
+is($m->stack->[0]->{wildcard},   'http:/www.google.com');
+is($m->url_for,                  '/wildcards/1/http:/www.google.com');
 is(@{$m->stack},                 1);
 $tx = Mojo::Transaction::HTTP->new;
 $tx->req->method('GET');
@@ -357,7 +357,7 @@
 is($m->stack->[0]->{controller}, 'wild');
 is($m->stack->[0]->{action},     'card');
 is($m->stack->[0]->{wildcard},   'http://www.google.com');
-is($m->url_for,                  '/wildcards/1/http://www.google.com');
+is($m->url_for,                  '/wildcards/1/http:/www.google.com');
 is(@{$m->stack},                 1);
 
 # Format




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