Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use File::Spec for path operations

Also make sure that the filename is relative before prepending a path.
  • Loading branch information...
commit 30fded2e676f25cbc69bcb84716682e28b4807f3 1 parent 4e5f14d
@nwellnhof authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Plack/Middleware/XSLT.pm
View
4 lib/Plack/Middleware/XSLT.pm
@@ -5,6 +5,7 @@ use strict;
use parent 'Plack::Middleware';
+use File::Spec;
use HTTP::Exception;
use Plack::Response;
use Plack::Util::Accessor qw(cache path parser_options);
@@ -23,7 +24,8 @@ sub call {
return $r if !defined($style) || $style eq '';
my $path = $self->path;
- $style = "$path/$style" if defined($path);
+ $style = File::Spec->catfile($path, $style)
+ if defined($path) && !File::Spec->file_name_is_absolute($style);
my ($status, $headers, $body) = @$r;
my $doc = $self->_parse_body($body);
Please sign in to comment.
Something went wrong with that request. Please try again.