From 74a228b0b842e4aeb8cc9326c5d10c1fe4f4ce06 Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 25 Jun 2013 12:09:22 +0200 Subject: New var name to make it more comprehensive Changes to follow the styleguide, proposed by narfbg (thanks to him) --- system/libraries/Upload.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 14863d69a..5861df584 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -140,7 +140,7 @@ class CI_Upload { * * @var string */ - public $file_ext_case = FALSE; + public $file_ext_tolower = FALSE; /** * Upload path @@ -301,7 +301,7 @@ class CI_Upload { 'file_type' => '', 'file_size' => NULL, 'file_ext' => '', - 'file_ext_case' => FALSE, + 'file_ext_tolower' => FALSE, 'upload_path' => '', 'overwrite' => FALSE, 'encrypt_name' => FALSE, @@ -974,10 +974,13 @@ class CI_Upload { { $x = explode('.', $filename); - if($this->file_ext_case) - return (count($x) !== 1) ? '.'.strtolower(end($x)) : ''; - else - return (count($x) !== 1) ? '.'.end($x) : ''; + if (count($x) === 1) + { + return ''; + } + + $ext = ($this->file_ext_tolower) ? strtolower(end($x)) : end($x); + return '.'.$ext; } // -------------------------------------------------------------------- @@ -1296,4 +1299,4 @@ class CI_Upload { } /* End of file Upload.php */ -/* Location: ./system/libraries/Upload.php */ +/* Location: ./system/libraries/Upload.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b