Make WordPress Core

Ticket #55257: 55257.map_deep_check_incomplete_objects.2.diff

File 55257.map_deep_check_incomplete_objects.2.diff, 627 bytes (added by costdev, 4 years ago)

Patch refresh with WPCS fixes.

  • src/wp-includes/formatting.php

    diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
    index 06e0f26aae..2771e05c2f 100644
    a b function sanitize_option( $option, $value ) { 
    50005000 * @return mixed The value with the callback applied to all non-arrays and non-objects inside it.
    50015001 */
    50025002function map_deep( $value, $callback ) {
     5003        if ( is_object( $value ) && $value instanceof __PHP_Incomplete_Class ) {
     5004                return $value;
     5005        }
     5006
    50035007        if ( is_array( $value ) ) {
    50045008                foreach ( $value as $index => $item ) {
    50055009                        $value[ $index ] = map_deep( $item, $callback );