summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Image_lib.php2
-rw-r--r--system/libraries/Upload.php7
2 files changed, 6 insertions, 3 deletions
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index 8902f524d..7f905128b 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -208,7 +208,7 @@ class CI_Image_lib {
}
else
{
- if (strpos($this->new_image, '/') === FALSE)
+ if (strpos($this->new_image, '/') === FALSE AND strpos($this->new_image, '\\') === FALSE)
{
$this->dest_folder = $this->source_folder;
$this->dest_image = $this->new_image;
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index fe5907ab2..506d15897 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -1042,14 +1042,17 @@ class CI_Upload {
if (function_exists('mime_content_type'))
{
$this->file_type = @mime_content_type($file['tmp_name']);
- return;
+ if (strlen($this->file_type) > 0) // Turns out it's possible that mime_content_type() returns FALSE or an empty string
+ {
+ return;
+ }
}
/* This is an ugly hack, but UNIX-type systems provide a native way to detect the file type,
* which is still more secure than depending on the value of $_FILES[$field]['type'].
*
* Notes:
- * - a 'W' in the substr() expression bellow, would mean that we're using Windows
+ * - the DIRECTORY_SEPARATOR comparison ensures that we're not on a Windows system
* - many system admins would disable the exec() function due to security concerns, hence the function_exists() check
*/
if (DIRECTORY_SEPARATOR !== '\\' && function_exists('exec'))