Changeset 56423 for branches/6.3/src/wp-includes/blocks/footnotes.php
- Timestamp:
- 08/22/2023 09:57:53 AM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.3/src/wp-includes/blocks/footnotes.php
r56334 r56423 35 35 $footnotes = json_decode( $footnotes, true ); 36 36 37 if ( count( $footnotes ) === 0 ) {37 if ( ! is_array( $footnotes ) || count( $footnotes ) === 0 ) { 38 38 return ''; 39 39 } … … 99 99 if ( $footnotes ) { 100 100 // Can't use update_post_meta() because it doesn't allow revisions. 101 update_metadata( 'post', $revision_id, 'footnotes', $footnotes);101 update_metadata( 'post', $revision_id, 'footnotes', wp_slash( $footnotes ) ); 102 102 } 103 103 } … … 155 155 if ( $footnotes ) { 156 156 // Can't use update_post_meta() because it doesn't allow revisions. 157 update_metadata( 'post', $wp_temporary_footnote_revision_id, 'footnotes', $footnotes);157 update_metadata( 'post', $wp_temporary_footnote_revision_id, 'footnotes', wp_slash( $footnotes ) ); 158 158 } 159 159 } … … 161 161 } 162 162 163 foreach ( array( 'post', 'page' ) as $post_type ) { 164 add_action( "rest_after_insert_{$post_type}", 'wp_add_footnotes_revisions_to_post_meta' ); 165 } 163 add_action( 'rest_after_insert_post', 'wp_add_footnotes_revisions_to_post_meta' ); 164 add_action( 'rest_after_insert_page', 'wp_add_footnotes_revisions_to_post_meta' ); 166 165 167 166 /** … … 177 176 178 177 if ( $footnotes ) { 179 update_post_meta( $post_id, 'footnotes', $footnotes);178 update_post_meta( $post_id, 'footnotes', wp_slash( $footnotes ) ); 180 179 } else { 181 180 delete_post_meta( $post_id, 'footnotes' ); … … 244 243 } 245 244 246 update_post_meta( $id, 'footnotes', $body['meta']['footnotes']);245 update_post_meta( $id, 'footnotes', wp_slash( $body['meta']['footnotes'] ) ); 247 246 } 248 247 // See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L391C1-L391C1.
Note: See TracChangeset
for help on using the changeset viewer.