Make WordPress Core

Ticket #33073: 33073-2025.patch

File 33073-2025.patch, 5.9 KB (added by rahultank, 7 months ago)

Updated patch for 2025 - adds translator comments warning against HTML entities for RSS feeds and email contexts

  • src/wp-includes/feed-atom-comments.php

    diff --git a/src/wp-includes/feed-atom-comments.php b/src/wp-includes/feed-atom-comments.php
    index 1de77e3917..dc8060395c 100644
    a b do_action( 'rss_tag_pre', 'atom-comments' ); 
    3030        <title type="text">
    3131        <?php
    3232        if ( is_singular() ) {
    33                 /* translators: Comments feed title. %s: Post title. */
     33                /* translators: Comments feed title. %s: Post title. Do not use HTML entities (&nbsp;, etc.) - used in RSS feeds. */
    3434                printf( ent2ncr( __( 'Comments on %s' ) ), get_the_title_rss() );
    3535        } elseif ( is_search() ) {
    36                 /* translators: Comments feed title. 1: Site title, 2: Search query. */
     36                /* translators: Comments feed title. 1: Site title, 2: Search query. Do not use HTML entities (&nbsp;, etc.) - used in RSS feeds. */
    3737                printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );
    3838        } else {
    39                 /* translators: Comments feed title. %s: Site title. */
     39                /* translators: Comments feed title. %s: Site title. Do not use HTML entities (&nbsp;, etc.) - used in RSS feeds. */
    4040                printf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() );
    4141        }
    4242        ?>
    while ( have_comments() ) : 
    8282                        $title = get_the_title( $comment_post->ID );
    8383                        /** This filter is documented in wp-includes/feed.php */
    8484                        $title = apply_filters( 'the_title_rss', $title );
    85                         /* translators: Individual comment title. 1: Post title, 2: Comment author name. */
     85                        /* translators: Individual comment title. 1: Post title, 2: Comment author name. Do not use HTML entities (&nbsp;, etc.) - used in RSS feeds. */
    8686                        printf( ent2ncr( __( 'Comment on %1$s by %2$s' ) ), $title, get_comment_author_rss() );
    8787                } else {
    88                         /* translators: Comment author title. %s: Comment author name. */
     88                        /* translators: Comment author title. %s: Comment author name. Do not use HTML entities (&nbsp;, etc.) - used in RSS feeds. */
    8989                        printf( ent2ncr( __( 'By: %s' ) ), get_comment_author_rss() );
    9090                }
    9191                ?>
  • src/wp-includes/feed-rss2-comments.php

    diff --git a/src/wp-includes/feed-rss2-comments.php b/src/wp-includes/feed-rss2-comments.php
    index 85a4079fa0..d36d5a8e30 100644
    a b do_action( 'rss_tag_pre', 'rss2-comments' ); 
    3535        <title>
    3636        <?php
    3737        if ( is_singular() ) {
    38                 /* translators: Comments feed title. %s: Post title. */
     38                /* translators: Comments feed title. %s: Post title. Do not use HTML entities (&nbsp;, etc.) - used in RSS feeds. */
    3939                printf( ent2ncr( __( 'Comments on: %s' ) ), get_the_title_rss() );
    4040        } elseif ( is_search() ) {
    41                 /* translators: Comments feed title. 1: Site title, 2: Search query. */
     41                /* translators: Comments feed title. 1: Site title, 2: Search query. Do not use HTML entities (&nbsp;, etc.) - used in RSS feeds. */
    4242                printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );
    4343        } else {
    44                 /* translators: Comments feed title. %s: Site title. */
     44                /* translators: Comments feed title. %s: Site title. Do not use HTML entities (&nbsp;, etc.) - used in RSS feeds. */
    4545                printf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() );
    4646        }
    4747        ?>
    do_action( 'rss_tag_pre', 'rss2-comments' ); 
    8585                        $title = get_the_title( $comment_post->ID );
    8686                        /** This filter is documented in wp-includes/feed.php */
    8787                        $title = apply_filters( 'the_title_rss', $title );
    88                         /* translators: Individual comment title. 1: Post title, 2: Comment author name. */
     88                        /* translators: Individual comment title. 1: Post title, 2: Comment author name. Do not use HTML entities (&nbsp;, etc.) - used in RSS feeds. */
    8989                        printf( ent2ncr( __( 'Comment on %1$s by %2$s' ) ), $title, get_comment_author_rss() );
    9090                } else {
    91                         /* translators: Comment author title. %s: Comment author name. */
     91                        /* translators: Comment author title. %s: Comment author name. Do not use HTML entities (&nbsp;, etc.) - used in RSS feeds. */
    9292                        printf( ent2ncr( __( 'By: %s' ) ), get_comment_author_rss() );
    9393                }
    9494                ?>
  • src/wp-includes/pluggable.php

    diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php
    index 1dbac5e1d7..9567aa3640 100644
    a b if ( ! function_exists( 'wp_notify_postauthor' ) ) : 
    17921792                                        $notify_message = sprintf( __( 'New trackback on your post "%s"' ), $post->post_title ) . "\r\n";
    17931793                                        /* translators: 1: Trackback/pingback website name, 2: Website IP address, 3: Website hostname. */
    17941794                                        $notify_message .= sprintf( __( 'Website: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
    1795                                         /* translators: %s: Trackback/pingback/comment author URL. */
     1795                                        /* translators: %s: Trackback/pingback/comment author URL. Do not use HTML entities (&nbsp;, etc.) - used in emails. */
    17961796                                        $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
    17971797                                        /* translators: %s: Comment text. */
    17981798                                        $notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
    if ( ! function_exists( 'wp_notify_postauthor' ) ) : 
    18061806                                        $notify_message = sprintf( __( 'New pingback on your post "%s"' ), $post->post_title ) . "\r\n";
    18071807                                        /* translators: 1: Trackback/pingback website name, 2: Website IP address, 3: Website hostname. */
    18081808                                        $notify_message .= sprintf( __( 'Website: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
    1809                                         /* translators: %s: Trackback/pingback/comment author URL. */
     1809                                        /* translators: %s: Trackback/pingback/comment author URL. Do not use HTML entities (&nbsp;, etc.) - used in emails. */
    18101810                                        $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
    18111811                                        /* translators: %s: Comment text. */
    18121812                                        $notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";