Make WordPress Core

Opened 4 weeks 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: trunk
Component: Upgrade/Install Keywords: reporter-feedback
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 (1)

#1 in reply to: ↑ description @SergeyBiryukov
4 weeks 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.

Note: See TracTickets for help on using tickets.