From dee9a010b01795848b67dc23e8ff11826060c389 Mon Sep 17 00:00:00 2001 From: Open Melody Software Group Date: Tue, 13 Jul 2010 16:08:22 -1000 Subject: [PATCH] Corrected warning that $ext was being unnecessarily reinitialized in MT::CMS::Asset::_upload_file at line 1343. This is an unrelated part that was included in the MTOS checkin the previous commit was based on (http://code.sixapart.com/trac/movabletype/changeset/5365) but missing from the previous commit itself. --- lib/MT/CMS/Asset.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/MT/CMS/Asset.pm b/lib/MT/CMS/Asset.pm index 9d1d9aa12..345beba4d 100644 --- a/lib/MT/CMS/Asset.pm +++ b/lib/MT/CMS/Asset.pm @@ -1289,10 +1289,12 @@ sub _upload_file { $ext = $1; ## Those characters are the file extension my ($w, $h, $id, $write_file) = MT::Image->check_upload( - Fh => $fh, Fmgr => $fmgr, Local => $local_file, - Max => $upload_param{max_size}, - MaxDim => $upload_param{max_image_dimension}, - ext => $ext, + Fh => $fh, + Fmgr => $fmgr, + Local => $local_file, + Max => $upload_param{max_size}, + MaxDim => $upload_param{max_image_dimension}, + ext => $ext, LocalBase => $local_base ); @@ -1346,7 +1348,7 @@ sub _upload_file { require File::Basename; my $local_basename = File::Basename::basename($local_file); - my $ext = + $ext = ( File::Basename::fileparse( $local_file, qr/[A-Za-z0-9]+$/ ) )[2]; require MT::Asset;