[wp-trac] [WordPress Trac] #63173: FS_Method with ftpext and Core Updates

WordPress Trac noreply at wordpress.org
Fri Mar 28 11:18:52 UTC 2025


#63173: FS_Method with ftpext and Core Updates
-------------------------------------------------+-------------------------
 Reporter:  SirLouen                             |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Filesystem API                       |     Version:  trunk
 Severity:  major                                |  Resolution:
 Keywords:  has-testing-info dev-feedback has-   |     Focuses:
  patch needs-copy-review                        |
-------------------------------------------------+-------------------------
Changes (by SirLouen):

 * keywords:  has-testing-info needs-testing dev-feedback has-patch => has-
     testing-info dev-feedback has-patch needs-copy-review


Comment:

 Just for more context, I want to provide just one example of what's going
 on (and this problem is scaling big): https://github.com/WordPress
 /wordpress-develop/blob/baab2b8f2273319817edede1b3360f212cf42241/src/wp-
 admin/includes/update-core.php#L1296-L1297

 In a `ftpext`, this is the delete operation: https://github.com/WordPress
 /wordpress-develop/blob/baab2b8f2273319817edede1b3360f212cf42241/src/wp-
 admin/includes/class-wp-filesystem-ftpext.php#L399-L400

 And in direct: https://github.com/WordPress/wordpress-
 develop/blob/baab2b8f2273319817edede1b3360f212cf42241/src/wp-
 admin/includes/class-wp-filesystem-direct.php#L373-L391

 `.maintenance` is a file. But the deletion of `.maintenance` is being
 handled as a directory (in fact, since it's not a directory and the
 function is not called as recursive, it will **always** be jumping to a
 recursive delete mode because this line is not specifying that it's a file
 with the 'f' type)

 Yes, everything is working because ultimately this recursive function will
 end deleting most files. But as soon as we play with a more sensible
 filesystem (like in the sample I'm analyzing, a very specific FTP with
 `ftpext`), everything falls apart. And this is affecting a nice amount of
 deletes, file creations as mkdirs, etc…

 And this is why this report became a blocker to me (truly irrelevant
 blocker by the way because the warning was still there and the reason of
 why I started debugging all this)

 So probably for the average user, this is completely irrelevant. But, as I
 say, this must be fixed taking all this context in mind. An innocuous
 patch that brings more good than evil.

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


More information about the wp-trac mailing list