Upgrades: When upgrading via FTP, use LIST -a to detect if a file exists.

`LIST` & `NLST` by default on some servers require the `-a` flag to view hidden files (ie. `.maintenance`)
Although we could simply pass the `-a` flag to `NLST`, opting to use `LIST` which we use elsewhere should mean less chance of server incompatibilities.

Props jcroucher.
Fixes #28013.


git-svn-id: https://develop.svn.wordpress.org/trunk@33648 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2015-08-19 12:37:56 +00:00
parent 63fd3a32dd
commit f0ec4d5a7b
2 changed files with 2 additions and 2 deletions

View File

@ -282,7 +282,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
* @return bool
*/
public function exists($file) {
$list = @ftp_nlist($this->link, $file);
$list = @ftp_rawlist( $this->link, '-a ' . $file );
if ( empty( $list ) && $this->is_dir( $file ) ) {
return true; // File is an empty directory.

View File

@ -290,7 +290,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
* @return bool
*/
public function exists( $file ) {
$list = $this->ftp->nlist( $file );
$list = $this->ftp->rawlist( $file, '-a' );
if ( empty( $list ) && $this->is_dir( $file ) ) {
return true; // File is an empty directory.