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. Built from https://develop.svn.wordpress.org/trunk@33648 git-svn-id: http://core.svn.wordpress.org/trunk@33615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user