From: Marcus Ramberg Date: Sun, 18 Mar 2007 19:26:42 +0000 (+0000) Subject: Warning in uri_for X-Git-Tag: 5.7099_04~225 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=c45c5d3787dfb147d4bfb4542283f52a3223fa87;hp=65bf97ed1423e79aa74b1ab14556913f52317768 Warning in uri_for --- diff --git a/Changes b/Changes index f001d38..7b4caae 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ This file documents the revision history for Perl extension Catalyst. + - Add warning in uri_for + 5.7007 2006-03-13 14:18:00 - Performance and stability improvements to the built-in HTTP server. - Don't ignore file uploads if form contains a text field with the diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 04d8d82..ea7117a 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -24,7 +24,7 @@ use Tree::Simple qw/use_weak_refs/; use Tree::Simple::Visitor::FindByUID; use attributes; use utf8; -use Carp qw/croak/; +use Carp qw/croak carp/; BEGIN { require 5.008001; } @@ -949,7 +949,13 @@ sub uri_for { }; # join args with '/', or a blank string - my $args = ( scalar @args ? '/' . join( '/', map {s/\?/%3F/g; $_} @args ) : '' ); + my $args = ( scalar @args ? '/' . join( '/', map { + unless (defined) { + carp "uri_for called with undefined argument"; + $_=''; + } + s/\?/%3F/g; $_ + } @args ) : '' ); $args =~ s/^\/// unless $path; my $res = URI->new_abs( URI->new_abs( "$path$args", "$basepath$namespace" ), $base )