Make WordPress Core

Changeset 53958


Ignore:
Timestamp:
08/30/2022 03:13:46 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Posts, Post Types: Escape output within the_meta().

Convert markup to entities when displaying on the front end. Deprecates the_meta() in favor of get_post_meta().

Props tykoted, martinkrcho, xknown, dd32, peterwilsoncc, paulkevan, timothyblynjacobs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-template.php

    r53876 r53958  
    10911091 * @since 1.2.0
    10921092 *
    1093  * @internal This will probably change at some point...
     1093 * @deprecated 6.0.2 Use get_post_meta() to retrieve post meta and render manually.
    10941094 */
    10951095function the_meta() {
     1096    _deprecated_function( __FUNCTION__, '6.0.2', 'get_post_meta()' );
    10961097    $keys = get_post_custom_keys();
    10971098    if ( $keys ) {
     
    11091110                "<li><span class='post-meta-key'>%s</span> %s</li>\n",
    11101111                /* translators: %s: Post custom field name. */
    1111                 sprintf( _x( '%s:', 'Post custom field name' ), $key ),
    1112                 $value
     1112                esc_html( sprintf( _x( '%s:', 'Post custom field name' ), $key ) ),
     1113                esc_html( $value )
    11131114            );
    11141115
Note: See TracChangeset for help on using the changeset viewer.