summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2017-02-14 10:56:59 +0100
committerGitHub <noreply@github.com>2017-02-14 10:56:59 +0100
commit7c25e642a1741fcba5a82a17b110332095ea3faa (patch)
treebd2733e9ff1eec51a0cf6550cabb31b55dab1a29 /system
parent2baad47c3051911b95960fd3d356edb581e36124 (diff)
parentb27e4451ee2ae65581f3245971155927c75d6ec7 (diff)
Merge pull request #5018 from zploskey/download_helper_refactor
Don't duplicate is_file() and filesize() checks in download helper
Diffstat (limited to 'system')
-rw-r--r--system/helpers/download_helper.php15
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
{