Permalink
Browse files

fix a bug in Mojo::File where parts of a path could get accidentally …

…upgraded from bytes to characters (closes #1131)
  • Loading branch information...
kraih committed Oct 5, 2017
1 parent dea681a commit 0c478792e1229841a11e7e54a18ca48bd80b3d11
Showing with 7 additions and 1 deletion.
  1. +3 −1 Changes
  2. +4 −0 lib/Mojo/File.pm
View
@@ -1,6 +1,8 @@
7.47 2017-10-03
7.47 2017-10-05
- Added multipart content generator to Mojo::UserAgent::Transactor.
- Fixed a bug in Mojo::File where parts of a path could get accidentally
upgraded from bytes to characters.
7.46 2017-09-12
- Fixed support for versions of IO::Socket::SSL older than 1.965 again.
View
@@ -78,6 +78,10 @@ sub move_to {
sub new {
my $class = shift;
# File systems require bytes, make sure we don't accidentally upgrade
utf8::downgrade $_, 1 for @_;
my $value = @_ == 1 ? $_[0] : @_ > 1 ? catfile @_ : canonpath getcwd;
return bless \$value, ref $class || $class;
}

0 comments on commit 0c47879

Please sign in to comment.