mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-16 16:43:42 +03:00
Contributors: Apply ??
before array cast, to avoid PHP notice.
Previously the `$user->team_names` would be cast to an array before the null coalescing operator executed. If the `team_names` field wasn't set in the database, PHP would throw an error before trying to apply the null coalescing operator.
This commit is contained in:
parent
993bd53765
commit
8c28881812
|
@ -652,7 +652,7 @@ function get_inactive_contributor_batch() : array {
|
|||
}
|
||||
|
||||
$user->hours_per_week = absint( $user->hours_per_week ?? 0 );
|
||||
$user->team_names = (array) $user->team_names ?? array();
|
||||
$user->team_names = (array) ( $user->team_names ?? array() );
|
||||
|
||||
unset( $user->field_ids, $user->field_values ); // Remove the concatenated data now that it's exploded.
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue