Index: wp-admin/includes/class-wp-filesystem-direct.php
===================================================================
--- wp-admin/includes/class-wp-filesystem-direct.php	(revision 11906)
+++ wp-admin/includes/class-wp-filesystem-direct.php	(working copy)
@@ -307,31 +307,36 @@
 		return @rmdir($path);
 	}
 
-	function dirlist($path, $incdot = false, $recursive = false) {
+	function dirlist($path, $include_hidden = true, $recursive = false) {
 		if ( $this->is_file($path) ) {
-			$limitFile = basename($path);
+			$limit_file = basename($path);
 			$path = dirname($path);
 		} else {
-			$limitFile = false;
+			$limit_file = false;
 		}
+
 		if ( ! $this->is_dir($path) )
 			return false;
 
-		$ret = array();
 		$dir = @dir($path);
 		if ( ! $dir )
 			return false;
+
+		$ret = array();
+
 		while (false !== ($entry = $dir->read()) ) {
 			$struc = array();
 			$struc['name'] = $entry;
 
 			if ( '.' == $struc['name'] || '..' == $struc['name'] )
-				continue; //Do not care about these folders.
-			if ( '.' == $struc['name'][0] && !$incdot)
 				continue;
-			if ( $limitFile && $struc['name'] != $limitFile)
+
+			if ( ! $include_hidden && '.' == $struc['name'][0] )
 				continue;
 
+			if ( $limit_file && $struc['name'] != $limit_file)
+				continue;
+
 			$struc['perms'] 	= $this->gethchmod($path.'/'.$entry);
 			$struc['permsn']	= $this->getnumchmodfromh($struc['perms']);
 			$struc['number'] 	= false;
@@ -345,7 +350,7 @@
 
 			if ( 'd' == $struc['type'] ) {
 				if ( $recursive )
-					$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
+					$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
 				else
 					$struc['files'] = array();
 			}
Index: wp-admin/includes/class-wp-filesystem-ftpext.php
===================================================================
--- wp-admin/includes/class-wp-filesystem-ftpext.php	(revision 11906)
+++ wp-admin/includes/class-wp-filesystem-ftpext.php	(working copy)
@@ -323,12 +323,12 @@
 		return $b;
 	}
 
-	function dirlist($path = '.', $incdot = false, $recursive = false) {
-		if ( $this->is_file($path) ) {
-			$limitFile = basename($path);
+	function dirlist($path = '.', $include_hidden = true, $recursive = false) {
+		if ( $this->is_file($path) )
+			$limit_file = basename($path);
 			$path = dirname($path) . '/';
 		} else {
-			$limitFile = false;
+			$limit_file = false;
 		}
 
 		$list = @ftp_rawlist($this->link, '-a ' . $path, false);
@@ -342,36 +342,31 @@
 			if ( empty($entry) )
 				continue;
 
-			if ( '.' == $entry["name"] || '..' == $entry["name"] )
+			if ( '.' == $entry['name'] || '..' == $entry['name'] )
 				continue;
 
+			if ( ! $include_hidden && '.' == $entry['name'][0] )
+				continue;
+
+			if ( $limit_file && $entry['name'] != $limit_file)
+				continue;
+
 			$dirlist[ $entry['name'] ] = $entry;
 		}
 
 		if ( ! $dirlist )
 			return false;
-		if ( empty($dirlist) )
-			return array();
 
 		$ret = array();
-		foreach ( $dirlist as $struc ) {
-
+		foreach ( (array)$dirlist as $struc ) {
 			if ( 'd' == $struc['type'] ) {
-				$struc['files'] = array();
-
-				if ( $incdot ) {
-					//We're including the doted starts
-					if ( '.' != $struc['name'] && '..' != $struc['name'] ) { //Ok, It isnt a special folder
-						if ($recursive)
-							$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
-					}
-				} else { //No dots
-					if ($recursive)
-						$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
-				}
+				if ( $recursive )
+					$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
+				else
+					$struc['files'] = array();
 			}
-			//File
-			$ret[$struc['name']] = $struc;
+
+			$ret[ $struc['name'] ] = $struc;
 		}
 		return $ret;
 	}
Index: wp-admin/includes/class-wp-filesystem-ftpsockets.php
===================================================================
--- wp-admin/includes/class-wp-filesystem-ftpsockets.php	(revision 11906)
+++ wp-admin/includes/class-wp-filesystem-ftpsockets.php	(working copy)
@@ -122,7 +122,7 @@
 		$this->ftp->SetType($type);
 
 		$temp = wp_tempnam( $file );
-		if ( ! $temphandle = fopen($temp, 'w+') ){
+		if ( ! $temphandle = fopen($temp, 'w+') ) {
 			unlink($temp);
 			return false;
 		}
@@ -166,11 +166,12 @@
 		if ( ! $recursive || ! $this->is_dir($file) ) {
 			return $this->ftp->chmod($file, $mode);
 		}
+
 		//Is a directory, and we want recursive
 		$filelist = $this->dirlist($file);
-		foreach($filelist as $filename){
+		foreach ( $filelist as $filename )
 			$this->chmod($file . '/' . $filename, $mode, $recursive);
-		}
+
 		return true;
 	}
 
@@ -282,39 +283,38 @@
 		return $this->ftp->mdel($path);
 	}
 
-	function dirlist($path = '.', $incdot = false, $recursive = false ) {
+	function dirlist($path = '.', $include_hidden = true, $recursive = false ) {
 		if ( $this->is_file($path) ) {
-			$limitFile = basename($path);
+			$limit_file = basename($path);
 			$path = dirname($path) . '/';
 		} else {
-			$limitFile = false;
+			$limit_file = false;
 		}
 
 		$list = $this->ftp->dirlist($path);
 		if ( ! $list )
 			return false;
-		if ( empty($list) )
-			return array();
 
 		$ret = array();
 		foreach ( $list as $struc ) {
 
+			if ( '.' == $struct['name'] || '..' == $struc['name'] )
+				continue;
+
+			if ( ! $include_hidden && '.' == $struc['name'][0] )
+				continue;
+
+			if ( $limit_file && $srtuc['name'] != $limit_file)
+				continue;
+
 			if ( 'd' == $struc['type'] ) {
-				$struc['files'] = array();
+				if ( $recursive )
+					$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
+				else
+					$struc['files'] = array();
+			}
 
-				if ( $incdot ){
-					//We're including the doted starts
-					if ( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder
-						if ($recursive)
-							$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
-					}
-				} else { //No dots
-					if ($recursive)
-						$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
-				}
-			}
-			//File
-			$ret[$struc['name']] = $struc;
+			$ret[ $struc['name'] ] = $struc;
 		}
 		return $ret;
 	}
Index: wp-admin/includes/class-wp-filesystem-ssh2.php
===================================================================
--- wp-admin/includes/class-wp-filesystem-ssh2.php	(revision 11906)
+++ wp-admin/includes/class-wp-filesystem-ssh2.php	(working copy)
@@ -322,29 +322,34 @@
 		return $this->delete($path, $recursive);
 	}
 
-	function dirlist($path, $incdot = false, $recursive = false) {
+	function dirlist($path, $include_hidden = true, $recursive = false) {
 		if ( $this->is_file($path) ) {
-			$limitFile = basename($path);
+			$limit_file = basename($path);
 			$path = dirname($path);
 		} else {
-			$limitFile = false;
+			$limit_file = false;
 		}
+
 		if ( ! $this->is_dir($path) )
 			return false;
 
 		$ret = array();
 		$dir = @dir('ssh2.sftp://' . $this->sftp_link .'/' . ltrim($path, '/') );
+
 		if ( ! $dir )
 			return false;
+
 		while (false !== ($entry = $dir->read()) ) {
 			$struc = array();
 			$struc['name'] = $entry;
 
 			if ( '.' == $struc['name'] || '..' == $struc['name'] )
 				continue; //Do not care about these folders.
-			if ( '.' == $struc['name'][0] && !$incdot)
+
+			if ( ! $include_hidden && '.' == $struc['name'][0] )
 				continue;
-			if ( $limitFile && $struc['name'] != $limitFile)
+
+			if ( $limit_file && $struc['name'] != $limit_file)
 				continue;
 
 			$struc['perms'] 	= $this->gethchmod($path.'/'.$entry);
@@ -360,7 +365,7 @@
 
 			if ( 'd' == $struc['type'] ) {
 				if ( $recursive )
-					$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
+					$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
 				else
 					$struc['files'] = array();
 			}
