WordPress.org

Make WordPress Core

Ticket #35058: Remove_for_loop_iteration__by_reference__to_avoid_fatal_php_error.patch

File Remove_for_loop_iteration__by_reference__to_avoid_fatal_php_error.patch, 638 bytes (added by jeff@…, 6 years ago)

Patch to avoid PHP fatal error when recursing through map_deep

  • src/wp-includes/formatting.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    38813881 */
    38823882function map_deep( $value, $callback ) {
    38833883        if ( is_array( $value ) || is_object( $value ) ) {
    3884                 foreach ( $value as &$item ) {
    3885                         $item = map_deep( $item, $callback );
     3884                foreach ( $value as $index => $item ) {
     3885                        $value[$index] = map_deep( $item, $callback );
    38863886                }
    38873887                return $value;
    38883888        } else {