WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/28/2014 06:34:16 PM (6 years ago)
Author:
pento
Message:

Add wp_json_encode(), a wrapper for json_encode() that ensures everything is converted to UTF-8.

Change all core calls from json_encode() to wp_json_encode().

Fixes #28786.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r29903 r30055  
    741741            'customize-widgets',
    742742            'data',
    743             sprintf( 'var _wpCustomizeWidgetsSettings = %s;', json_encode( $settings ) )
     743            sprintf( 'var _wpCustomizeWidgetsSettings = %s;', wp_json_encode( $settings ) )
    744744        );
    745745    }
     
    10561056        ?>
    10571057        <script type="text/javascript">
    1058             var _wpWidgetCustomizerPreviewSettings = <?php echo json_encode( $settings ); ?>;
     1058            var _wpWidgetCustomizerPreviewSettings = <?php echo wp_json_encode( $settings ); ?>;
    10591059        </script>
    10601060        <?php
Note: See TracChangeset for help on using the changeset viewer.