Make WordPress Core

Ticket #57405: 57405.patch

File 57405.patch, 870 bytes (added by dilipbheda, 2 years ago)

Here is the patch to fix this issue.

  • src/wp-includes/class-wp-scripts.php

    diff --git a/src/wp-includes/class-wp-scripts.php b/src/wp-includes/class-wp-scripts.php
    index 5374aa912a..b999455daa 100644
    a b class WP_Scripts extends WP_Dependencies { 
    511511                if ( is_string( $l10n ) ) {
    512512                        $l10n = html_entity_decode( $l10n, ENT_QUOTES, 'UTF-8' );
    513513                } elseif ( is_array( $l10n ) ) {
    514                         foreach ( $l10n as $key => $value ) {
    515                                 if ( ! is_scalar( $value ) ) {
    516                                         continue;
     514                        $l10n = map_deep(
     515                                $l10n,
     516                                function( $value ) {
     517                                        if ( ! is_scalar( $value ) ) {
     518                                                return;
     519                                        }
     520                                        return html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' );
    517521                                }
    518 
    519                                 $l10n[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' );
    520                         }
     522                        );
    521523                }
    522524
    523525                $script = "var $object_name = " . wp_json_encode( $l10n ) . ';';