Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#55387 assigned defect (bug)

$wp_filesystem->dirlist() can return false and that should be checked for before iterating over the return value

Reported by: pbiron's profile pbiron Owned by: pbiron's profile pbiron
Milestone: Future Release Priority: normal
Severity: normal Version: 2.8
Component: Filesystem API Keywords: has-patch
Focuses: Cc:

Description

There are a number of cases in core (e.g., https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-upgrader.php#L500) where the return value of $wp_filesystem->dirlist() is assumed to be an array. But since that method can return false, we should always check for that before iterating (or calling array_keys() or array_values() on it) over the return value.

Change History (4)

#1 @pbiron
2 years ago

  • Keywords needs-patch added

This ticket was mentioned in PR #2411 on WordPress/wordpress-develop by kapilpaul.


2 years ago
#2

  • Keywords has-patch added; needs-patch removed

#3 @costdev
2 years ago

  • Version set to 2.8

#4 @costdev
2 years ago

  • Milestone changed from 6.0 to Future Release

As this ticket still needs more work to investigate and implement an appropriate solution to each instance, I'm moving this to Future Release.

Note: See TracTickets for help on using tickets.