Make WordPress Core


Ignore:
Timestamp:
10/21/2025 07:11:53 AM (3 months ago)
Author:
ellatrix
Message:

Editor: update packages.

Updates the packages to match Gutenberg version 21.9.0 RC2.

Also updates the sync script to work with the new package-lock.json format.
Some reusable block tests were adjusted to work with more render arguments.
Added core-data to the ignore list for verify:source-maps because Yjs has been bundled by accident. To be removed in a follow-up. See https://core.trac.wordpress.org/ticket/64120. See https://github.com/WordPress/gutenberg/pull/72503.

See: https://github.com/WordPress/wordpress-develop/pull/10355.
See: https://core.trac.wordpress.org/ticket/64117.

Props ellatrix, dmsnell.
Fixes #64117.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/rss.php

    r59775 r61009  
    3232    $rss_items  = $rss->get_items( 0, $attributes['itemsToShow'] );
    3333    $list_items = '';
     34
     35    $open_in_new_tab = ! empty( $attributes['openInNewTab'] );
     36    $rel             = ! empty( $attributes['rel'] ) ? trim( $attributes['rel'] ) : '';
     37
     38    $link_attributes = '';
     39
     40    if ( $open_in_new_tab ) {
     41        $link_attributes .= ' target="_blank"';
     42    }
     43
     44    if ( '' !== $rel ) {
     45        $link_attributes .= ' rel="' . esc_attr( $rel ) . '"';
     46    }
     47
    3448    foreach ( $rss_items as $item ) {
    35         $title = esc_html( trim( strip_tags( $item->get_title() ) ) );
     49        $title = esc_html( trim( strip_tags( html_entity_decode( $item->get_title() ) ) ) );
     50
    3651        if ( empty( $title ) ) {
    3752            $title = __( '(no title)' );
     
    3954        $link = $item->get_link();
    4055        $link = esc_url( $link );
     56
    4157        if ( $link ) {
    42             $title = "<a href='{$link}'>{$title}</a>";
     58            $title = "<a href='{$link}'{$link_attributes}>{$title}</a>";
    4359        }
    4460        $title = "<div class='wp-block-rss__item-title'>{$title}</div>";
    4561
    46         $date = '';
    47         if ( $attributes['displayDate'] ) {
    48             $date = $item->get_date( 'U' );
     62        $date_markup = '';
     63        if ( ! empty( $attributes['displayDate'] ) ) {
     64            $timestamp = $item->get_date( 'U' );
    4965
    50             if ( $date ) {
    51                 $date = sprintf(
     66            if ( $timestamp ) {
     67                $gmt_offset = get_option( 'gmt_offset' );
     68                $timestamp += (int) ( (float) $gmt_offset * HOUR_IN_SECONDS );
     69
     70                $date_markup = sprintf(
    5271                    '<time datetime="%1$s" class="wp-block-rss__item-publish-date">%2$s</time> ',
    53                     esc_attr( date_i18n( 'c', $date ) ),
    54                     esc_attr( date_i18n( get_option( 'date_format' ), $date ) )
     72                    esc_attr( date_i18n( 'c', $timestamp ) ),
     73                    esc_html( date_i18n( get_option( 'date_format' ), $timestamp ) )
    5574                );
    5675            }
     
    86105        }
    87106
    88         $list_items .= "<li class='wp-block-rss__item'>{$title}{$date}{$author}{$excerpt}</li>";
     107        $list_items .= "<li class='wp-block-rss__item'>{$title}{$date_markup}{$author}{$excerpt}</li>";
    89108    }
    90109
Note: See TracChangeset for help on using the changeset viewer.