| @@ -47,11 +47,11 @@ | ||
| 47 | 47 | $option = $args[1]['option']; |
| 48 | 48 | $old = $args[1]['old_value']; |
| 49 | 49 | $new = $args[1]['value']; |
| 50 | 50 | $option_human_read = self::key_to_human_name( $option ); |
| 51 | - // To avoid the recursive compare if both are nested array, convert all to string. | |
| 52 | - $check1 = is_array( $old ) ? wp_json_encode( $old ) : $old; | |
| 53 | - $check2 = is_array( $new ) ? wp_json_encode( $new ) : $new; | |
| 51 | + // Normalize both values to strings (JSON for arrays/objects) so type-only changes, e.g. int 1 vs string "1", aren't logged. | |
| 52 | + $check1 = ( is_array( $old ) || is_object( $old ) ) ? wp_json_encode( $old ) : (string) $old; | |
| 53 | + $check2 = ( is_array( $new ) || is_object( $new ) ) ? wp_json_encode( $new ) : (string) $new; | |
| 54 | 54 | |
| 55 | 55 | if ( $check1 === $check2 ) { |
| 56 | 56 | return false; |
| 57 | 57 | } |
| @@ -81,9 +81,9 @@ | ||
| 81 | 81 | global $wp_locale; |
| 82 | 82 | $old_day = $wp_locale->get_weekday( $old ); |
| 83 | 83 | $new_day = $wp_locale->get_weekday( $new ); |
| 84 | 84 | $text = sprintf( |
| 85 | - /* translators: 1: Blog name, 2: User's display name, 3: Option: Week Starts On, 4: Old day, 5: New day */ | |
| 85 | + /* translators: 1: Blog name, 2: User's display name, 3: Option label, 4: Old option value, 5: New option value */ | |
| 86 | 86 | esc_html__( '%1$s %2$s update option %3$s from %4$s to %5$s', 'defender-security' ), |
| 87 | 87 | $blog_name, |
| 88 | 88 | $user_name, |
| 89 | 89 | $option_human_read, |
| @@ -233,9 +233,9 @@ | ||
| 233 | 233 | ) |
| 234 | 234 | ); |
| 235 | 235 | |
| 236 | 236 | if ( isset( $human_read[ $key ] ) ) { |
| 237 | - if ( empty( $human_read[ $key ] ) ) { | |
| 237 | + if ( '' === $human_read[ $key ] ) { | |
| 238 | 238 | return $key; |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | return $human_read[ $key ]; |