Make WordPress Core

Opened 6 weeks ago

Last modified 16 hours ago

#63197 new defect (bug)

Sanity Checks in mkdir and delete for FTPext Filesystem

Reported by:sirlouen's profile SirLouenOwned by:
Milestone:Awaiting ReviewPriority:normal
Severity:majorVersion:trunk
Component:Filesystem APIKeywords:needs-testing dev-feedback has-test-info has-
Focuses:Cc:

Description

I've noted that during the process of Core updating with FTP ext with a specific legit FTP setup I've created using the wordpress-develop + some edits in the docker containerization system, the update was throwing a ton of errors and ultimately failing.

This is the final revision of a series of reports to solve this.

Here is the FTP setup
https://core.trac.wordpress.org/ticket/63172

This is also needed, because it sorts some big issues with exists method in FTPext
https://core.trac.wordpress.org/ticket/63173

With these two es set-up and running, now we can proceed to test this.

Instructions to reproduce

  1. Set up a FTP. Ideally the root of the FTP should be / in the WP folder. For example, if you access your FTP with your credentials, your wp-content should be straight in /wp-content/, not in something like /var/www/wp-content or /home/youruser/website/wp-content/
  1. Set the ftpext FS_METHOD
  1. Set your credentials in wp-config.php minimally:
define( 'FS_METHOD', 'ftpext' );
define( 'FTP_USER', '.......' );
define( 'FTP_PASS', '.......' );
define( 'FTP_HOST', '......' );
  1. Run a core update and see all the errors.

Change History (2)

This ticket was mentioned in โ€‹PR #8618 on โ€‹WordPress/wordpress-develop by โ€‹@SirLouen.


6 weeks ago
#1

  • Keywords has- added

This introduces two little little checks for file/dir existence, one in mkdir and one in rmdir.

Generally mkdir and delete/rmdir functions introduce an error control operator to filter out the exists checks that are generally implicit in both functions (both to check if already exist, or if the directory doesn't exist, respectively).

This introduces two problems: This is against WordPress CS, and when debugging with track_errors enabled this is a pain in the stomach. For this reason, ideally the error control operator should avoided whenever possible and handle the special cases orderly. This said, the current state of functions were not even using this error control operator, so they were generating a ton of Warnings.

Trac ticket: https://core.trac.wordpress.org/ticket/63197

#2 @wordpressdotorg
16 hours ago

  • Keywords has-test-info added; has-testing-info removed
Note: See TracTickets for help on using tickets.