Fixed a bug - CI_Upload::_file_mime_type() could've failed if popen() is used for the detection.
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index 91fbf66..b0490de 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -1095,7 +1095,7 @@
 				$proc = @popen($cmd, 'r');
 				if (is_resource($proc))
 				{
-					$mime = @fread($test, 512);
+					$mime = @fread($proc, 512);
 					@pclose($proc);
 					if ($mime !== FALSE)
 					{