WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 3 years ago

#25741 new defect (bug)

Broken WP_Filesystem methods

Reported by: dd32 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Filesystem API Keywords: needs-patch
Focuses: Cc:

Description

The following methods of WP_Filesystem do not work as intended, as they're called with absolute paths, and fail to find those absolute paths within the relative paths returned from the listing functions:

  • WP_Filesystem_FTPext
    • owner()
    • getchmod()
    • group()
  • WP_Filesystem_ftpsockets
    • owner()
    • getchmod()
    • group()

It's worth noting that the following FTP methods are available but don't actually hit the filesystem, and are just there to match the WP_Filesystem_Direct methods:

  • is_readable()
  • is_writable()
  • atime()
  • touch()

Attached is a patch I had locally from during 3.7 development, not thoughly tested, I believe WP_Filesystem_FTPext::owner() at least needs extra work. The patch also removes the above methods from the FTP classes and relies upon the WP_Filesystem_Base versions - as a result, the is_writable() and is_readable() methods changed to assume things are readable/writable.

Attachments (1)

25741.diff (3.3 KB) - added by dd32 5 years ago.

Download all attachments as: .zip

Change History (3)

@dd32
5 years ago

#1 @DavidAnderson
5 years ago

See also this one, for two more broken methods (for different reasons), with patch: #26598

Last edited 5 years ago by SergeyBiryukov (previous) (diff)

#2 @chriscct7
3 years ago

  • Keywords needs-patch added; has-patch removed
Note: See TracTickets for help on using tickets.