Make WordPress Core

Ticket #25280: 25280.patch

File 25280.patch, 737 bytes (added by adamsilverstein, 11 years ago)

update against trunk

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

     
    145145                }
    146146
    147147                foreach ( (array) $l10n as $key => $value ) {
    148                         if ( !is_scalar($value) )
     148                        if ( is_bool( $value ) || ! is_scalar( $value ) )
    149149                                continue;
    150150
    151151                        $l10n[$key] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8');
    152152                }
    153153
    154                 $script = "var $object_name = " . json_encode($l10n) . ';';
     154                $script = "var $object_name = " . defined( 'JSON_NUMERIC_CHECK' ) ? json_encode( $l10n, JSON_NUMERIC_CHECK ) : json_encode( $l10n ) . ';';
    155155
    156156                if ( !empty($after) )
    157157                        $script .= "\n$after;";