Make WordPress Core

Ticket #60355: 60355.diff

File 60355.diff, 737 bytes (added by abditsori, 9 months ago)
  • src/wp-includes/formatting.php

    diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
    index 05b103e6f7..6504cee240 100644
    a b function map_deep( $value, $callback ) { 
    51455145        } elseif ( is_object( $value ) ) {
    51465146                $object_vars = get_object_vars( $value );
    51475147                foreach ( $object_vars as $property_name => $property_value ) {
    5148                         $value->$property_name = map_deep( $property_value, $callback );
     5148                        $reflection_property = new ReflectionProperty( $value, $property_name );
     5149                        if ( ! $reflection_property->isReadOnly() ) {
     5150                                $value->$property_name = map_deep( $property_value, $callback );
     5151                        }
    51495152                }
    51505153        } else {
    51515154                $value = call_user_func( $callback, $value );