Skip to content

Commit 1ed3533

Browse files
committed
revert empty content change and preserve the flag
1 parent 0b65721 commit 1ed3533

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/experimental/content-types/index.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,10 @@ function gutenberg_filter_user_taxonomy_post_content( $data ) {
174174

175175
$decoded = json_decode( wp_unslash( (string) $data['post_content'] ), true );
176176
if ( JSON_ERROR_NONE !== json_last_error() || ! is_array( $decoded ) ) {
177-
// Invalid JSON: store empty content so raw bytes can't leak.
178-
$data['post_content'] = '';
179-
return $data;
177+
// Hedge: invalid JSON falls through to a canonical empty payload so
178+
// a stray read path can't surface arbitrary bytes. The marker is
179+
// added below, keeping the stored shape uniform.
180+
$decoded = array();
180181
}
181182

182183
$clean = gutenberg_user_taxonomy_sanitize_config( $decoded );

0 commit comments

Comments
 (0)