use Tree::Simple::Visitor::FindByUID;
use attributes;
use utf8;
-use Carp qw/croak/;
+use Carp qw/croak carp/;
BEGIN { require 5.008001; }
# massage namespace, empty if absolute path
$namespace =~ s/^\/// if $namespace;
$namespace .= '/' if $namespace;
- $path ||= '';
+ $path = '' if !defined $path;
$namespace = '' if $path =~ /^\//;
$path =~ s/^\///;
$path =~ s/\?/%3F/g;
};
# join args with '/', or a blank string
- my $args = ( scalar @args ? '/' . join( '/', map {s/\?/%3F/g; $_} @args ) : '' );
- $args =~ s/^\/// unless $path;
+ my $args = ( scalar @args ? '/' . join( '/', map {
+ unless (defined) {
+ carp "uri_for called with undefined argument";
+ $_='';
+ }
+ s/\?/%3F/g; $_
+ } @args ) : '' );
+ $args =~ s/^\/// unless length $path;
my $res =
URI->new_abs( URI->new_abs( "$path$args", "$basepath$namespace" ), $base )
->canonical;
if ( !$c->response->body ) {
# Add a default body if none is already present
$c->response->body(
- "<p>This item has moved <a href=\"$location\">here</a>.</p>"
+ qq{<html><body><p>This item has moved <a href="$location">here</a>.</p></body></html>}
);
}
}