[wp-trac] [WordPress Trac] #61114: PHP 8+ Fatal Error in WP_Upgrader due to TypeError in array_keys() Call
WordPress Trac
noreply at wordpress.org
Thu Oct 10 23:32:56 UTC 2024
#61114: PHP 8+ Fatal Error in WP_Upgrader due to TypeError in array_keys() Call
-----------------------------+---------------------
Reporter: verygoode | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.7
Component: Upgrade/Install | Version: 2.8
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
-----------------------------+---------------------
Changes (by azaozz):
* milestone: Awaiting Review => 6.7
Comment:
Replying to [comment:8 verygoode]:
> Warning: Could not move the old version to the upgrade-temp-backup
directory.
Yep, I believe this is the right output when the plugin directory doesn't
exist. Just wondering if it may be better to add a more specific error
message there? Maybe the patch should be something like:
{{{
// Has the source location changed? If so, we need a new source_files
list.
if ( $source !== $remote_source ) {
$dir_list = $wp_filesystem->dirlist( $source );
if ( empty( $dir_list ) ) {
// Return new WP_ERROR
}
$source_files = array_keys( $dir_list );
}
}}}
This matches some of the existing code, see:
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-
wp-upgrader.php#L366
Moving to the 6.7 milestone for consideration.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61114#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list