Skip to content

Commit 1639b2b

Browse files
committed
Stop escaping slashes, json_encode dangerously
This helps demonstrate the effectiveness.
1 parent adc0ab3 commit 1639b2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/block-editor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ function block_editor_rest_api_preload( array $preload_paths, $block_editor_cont
766766
'wp-api-fetch',
767767
sprintf(
768768
'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );',
769-
wp_json_encode( $preload_data )
769+
wp_json_encode( $preload_data, JSON_UNESCAPED_SLASHES )
770770
),
771771
'after'
772772
);

0 commit comments

Comments
 (0)