Make WordPress Core

Opened 5 months ago

Last modified 4 weeks ago

#64510 new defect (bug)

_wp_delete_all_temp_backups not accounting for direct filesystem access

Reported by: i4nd90's profile i4nd90 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.3
Component: Upgrade/Install Keywords: reporter-feedback close
Focuses: Cc:

Description

wp-includes/update.php:1156

ob_start();
$credentials = request_filesystem_credentials( '' );
ob_end_clean();

if ( false === $credentials || ! WP_Filesystem( $credentials ) ) {
        wp_trigger_error( __FUNCTION__, __( 'Could not access filesystem.' ) );
        return;
}

If request_filesystem_credentials() evaluates that the type == 'direct', it return boolean of true, therefore the condition ! WP_Filesystem( $credentials ) is met and the upgrade-temp-backup dir never gets emptied

Change History (3)

#1 in reply to: ↑ description @SergeyBiryukov
5 months ago

  • Keywords reporter-feedback added

Replying to i4nd90:

If request_filesystem_credentials() evaluates that the type == 'direct', it return boolean of true, therefore the condition ! WP_Filesystem( $credentials ) is met

Hi there, welcome to WordPress Trac! Thanks for the ticket.

I could not reproduce the issue so far. In my testing, request_filesystem_credentials() does return true in this scenario, but then WP_Filesystem( $credentials ) also returns true (as it should on success), and the negative condition is not met.

If the condition is met on your install, that means there was an error somewhere in WP_Filesystem(), so some more investigation would be helpful here.

#2 @audrasjb
4 weeks ago

Removing trunk version as this is not going to be shipped with WP 7.0 but in the next releases.

#3 @desrosj
4 weeks ago

  • Keywords close added
  • Version changed from trunk to 6.3

_wp_delete_all_temp_backups() was introduced in WP 6.3, so updating the version field to reflect that.

@i4nd90 are you still experiencing this? Since another contributor has not been able to reproduce this, I am going to mark this with a close suggestion and return in a few weeks to close it out as worksforme if no additional details are provided.

Note: See TracTickets for help on using tickets.