mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
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:
parent
63fd3a32dd
commit
f0ec4d5a7b
@ -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.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user