Site Health: Fix debug data with nested fields for copying.

* Use `$debug_data` instead of `$field['value']` to retrieve the debug data.
* Rename inner variables to avoid overriding the output variable.

Props Clorith, ocean90.
See #46573.

git-svn-id: https://develop.svn.wordpress.org/trunk@45246 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling 2019-04-18 16:25:05 +00:00
parent eda377ba9e
commit 1eb665b20c
1 changed files with 2 additions and 2 deletions

View File

@ -1059,8 +1059,8 @@ class WP_Debug_Data {
if ( is_array( $debug_data ) ) {
$value = '';
foreach ( $field['value'] as $name => $value ) {
$value .= sprintf( "\n\t%s: %s", $name, $value );
foreach ( $debug_data as $sub_field_name => $sub_field_value ) {
$value .= sprintf( "\n\t%s: %s", $sub_field_name, $sub_field_value );
}
} elseif ( is_bool( $debug_data ) ) {
$value = $debug_data ? 'true' : 'false';