mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Docs: Improve @since notes for some WP_Filesystem_* methods:
* `WP_Filesystem_FTPext::exists()` * `WP_Filesystem_FTPext::size()` * `WP_Filesystem_ftpsockets::exists()` The `::exists()` methods were previously using the FTP `NLST` command, which works for directories, but is not intended to be applied to a file. This only worked most of the time due to many FTP servers being permissive and allowing to execute `NLST` on files, which cannot be guaranteed and appears to not be the case in newer versions of Pure-FTPd (1.0.48 or later). With a recent change in [53860], both methods were updated for compatibility with RFC 959: * Both methods check if the path is a directory that can be changed into (and therefore exists). * `WP_Filesystem_FTPext` uses `ftp_rawlist()` (FTP `LIST` command) to check for file existence. * `WP_Filesystem_ftpsockets` uses file size to check for file existence. Reference: [https://www.ietf.org/rfc/rfc959.txt RFC 959: File Transfer Protocol (FTP)] Follow-up to [6779], [11821], [25274], [33648], [34733], [35944], [35946], [53860]. See #51170. git-svn-id: https://develop.svn.wordpress.org/trunk@53862 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e14d94858f
commit
041a9256fb
@ -412,8 +412,8 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
* Checks if a file or directory exists.
|
||||
*
|
||||
* @since 2.5.0
|
||||
* @since 6.1.0 Rewrite using ftp_rawlist, uses 'LIST' on FTP server
|
||||
* takes file path or directory path as parameter.
|
||||
* @since 6.1.0 Uses WP_Filesystem_FTPext::is_dir() to check for directory existence
|
||||
* and ftp_rawlist() to check for file existence.
|
||||
*
|
||||
* @param string $file Path to file or directory.
|
||||
* @return bool Whether $file exists or not.
|
||||
@ -510,7 +510,8 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
* Gets the file size (in bytes).
|
||||
*
|
||||
* @since 2.5.0
|
||||
* @since 6.1.0 Update for proper return values.
|
||||
* @since 6.1.0 Corrected the return value: while WP_Filesystem_Base::size()
|
||||
* is documented to return false on failure, ftp_size() returns -1.
|
||||
*
|
||||
* @param string $file Path to file.
|
||||
* @return int Size of the file in bytes on success, -1 on failure.
|
||||
|
||||
@ -414,7 +414,8 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
* Checks if a file or directory exists.
|
||||
*
|
||||
* @since 2.5.0
|
||||
* @since 6.1.0 Rewrite using file size.
|
||||
* @since 6.1.0 Uses WP_Filesystem_ftpsockets::is_dir() to check for directory existence
|
||||
* and file size to check for file existence.
|
||||
*
|
||||
* @param string $file Path to file or directory.
|
||||
* @return bool Whether $file exists or not.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user