Make WordPress Core

Opened 6 months ago

Last modified 4 months 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: has-patch
Focuses: Cc:


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 6 months ago.

Download all attachments as: .zip

Change History (2)

dd326 months ago

comment:1 DavidAnderson4 months ago

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

Last edited 4 months ago by SergeyBiryukov (previous) (diff)
Note: See TracTickets for help on using tickets.