diff options
author | Zach Ploskey <zach@ploskey.com> | 2017-02-14 01:21:37 +0100 |
---|---|---|
committer | Zach Ploskey <zach@ploskey.com> | 2017-02-14 01:26:04 +0100 |
commit | b27e4451ee2ae65581f3245971155927c75d6ec7 (patch) | |
tree | bd2733e9ff1eec51a0cf6550cabb31b55dab1a29 | |
parent | 2baad47c3051911b95960fd3d356edb581e36124 (diff) |
Don't duplicate is_file and filesize checks
Move duplicate is_file and file_size checks out of if/else branches.
Signed-off-by: Zach Ploskey <zach@ploskey.com>
-rw-r--r-- | system/helpers/download_helper.php | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index ea3da1bf4..7500bc827 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -84,23 +84,18 @@ if ( ! function_exists('force_download')) { return; } - - if ( ! @is_file($filepath) OR ($filesize = @filesize($filepath)) === FALSE) - { - return; - } } else { - if ( ! @is_file($filename) OR ($filesize = @filesize($filename)) === FALSE) - { - return; - } - $filepath = $filename; $filename = explode('/', str_replace(DIRECTORY_SEPARATOR, '/', $filename)); $filename = end($filename); } + + if ( ! @is_file($filepath) OR ($filesize = @filesize($filepath)) === FALSE) + { + return; + } } else { |