[wp-trac] [WordPress Trac] #51170: FTP automatic updates are not RFC 959 compliant for NLST command

WordPress Trac noreply at wordpress.org
Mon Aug 8 17:33:35 UTC 2022


#51170: FTP automatic updates are not RFC 959 compliant for NLST command
------------------------------------+-----------------------
 Reporter:  giox069                 |       Owner:  audrasjb
     Type:  defect (bug)            |      Status:  reopened
 Priority:  normal                  |   Milestone:  6.1
Component:  Filesystem API          |     Version:  3.7
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch early commit  |     Focuses:
------------------------------------+-----------------------
Changes (by SergeyBiryukov):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Good catch on correcting the return value for
 `WP_Filesystem_FTPext::size()` in [53860]!

 However, that makes it inconsistent with all the other
 `WP_Filesystem_*::size()` methods:
 * `WP_Filesystem_Base::size()`
 * `WP_Filesystem_Direct::size()`
 * `WP_Filesystem_ftpsockets::size()`
 * `WP_Filesystem_SSH2::size()`
 {{{
 @return int|false Size of the file in bytes on success, false on failure.
 }}}

 This means we'd have to check both for `false` and for `-1` anywhere the
 `::size()` method is used, which increases complexity without a strong
 reason.

 As the purpose of the API is to provide a consistent interface for various
 filesystem implementations, I believe a better solution would be to update
 the return value to match the documented value instead. See
 [attachment:"51170.2.diff"].

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51170#comment:58>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list