Merge pull request #912 from narfbg/develop-fix-fh

Fixes for two previous commits
diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php
index cb5d439..7af3c48 100755
--- a/system/core/CodeIgniter.php
+++ b/system/core/CodeIgniter.php
@@ -267,7 +267,7 @@
 	$method = $RTR->fetch_method();
 
 	if ( ! class_exists($class)
-		OR strpos($method, '_', 1) === 0
+		OR strpos($method, '_') === 0
 		OR in_array(strtolower($method), array_map('strtolower', get_class_methods('CI_Controller')))
 		)
 	{
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index 9b39b8c..2d4b10e 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -196,16 +196,16 @@
 
 			while (FALSE !== ($file = readdir($fp)))
 			{
-				if (@is_dir($source_dir.$file) && strncmp($file, '.', 1) !== 0)
+				if (@is_dir($source_dir.$file) && $file[0] !== '.')
 				{
 					get_filenames($source_dir.$file.DIRECTORY_SEPARATOR, $include_path, TRUE);
 				}
-				elseif (strncmp($file, '.', 1) !== 0)
+				elseif ($file[0] !== '.')
 				{
 					$_filedata[] = ($include_path == TRUE) ? $source_dir.$file : $file;
 				}
 			}
-			closedir($source_dir);
+			closedir($fp);
 
 			return $_filedata;
 		}
@@ -249,17 +249,17 @@
 			// foreach (scandir($source_dir, 1) as $file) // In addition to being PHP5+, scandir() is simply not as fast
 			while (FALSE !== ($file = readdir($fp)))
 			{
-				if (@is_dir($source_dir.$file) AND strncmp($file, '.', 1) !== 0 AND $top_level_only === FALSE)
+				if (@is_dir($source_dir.$file) && $file[0] !== '.' && $top_level_only === FALSE)
 				{
 					get_dir_file_info($source_dir.$file.DIRECTORY_SEPARATOR, $top_level_only, TRUE);
 				}
-				elseif (strncmp($file, '.', 1) !== 0)
+				elseif ($file[0] !== '.')
 				{
 					$_filedata[$file] = get_file_info($source_dir.$file);
 					$_filedata[$file]['relative_path'] = $relative_path;
 				}
 			}
-			closedir($source_dir);
+			closedir($fp);
 
 			return $_filedata;
 		}
@@ -359,7 +359,7 @@
 
 		if ( ! is_array($mimes))
 		{
-			if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
+			if (defined('ENVIRONMENT') && is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
 			{
 				include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
 			}