Changeset 51681 for branches/5.8/src/wp-includes/blocks.php
- Timestamp:
- 08/27/2021 07:08:21 PM (3 years ago)
- Location:
- branches/5.8
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.8
-
branches/5.8/src/wp-includes/blocks.php
r51382 r51681 489 489 * the result in an HTML comment. 490 490 * 491 * This function must produce output that remains in sync with the output of 492 * the serializeAttributes JavaScript function in the block editor in order 493 * to ensure consistent operation between PHP and JavaScript. 494 * 491 495 * @since 5.3.1 492 496 * … … 495 499 */ 496 500 function serialize_block_attributes( $block_attributes ) { 497 $encoded_attributes = json_encode( $block_attributes);501 $encoded_attributes = wp_json_encode( $block_attributes, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ); 498 502 $encoded_attributes = preg_replace( '/--/', '\\u002d\\u002d', $encoded_attributes ); 499 503 $encoded_attributes = preg_replace( '/</', '\\u003c', $encoded_attributes );
Note: See TracChangeset
for help on using the changeset viewer.