Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/27/2024 01:40:03 AM (9 months ago)
Author:
imath
Message:

Messages component: improve PHP code standards using WPCS

See #7228 (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/classes/class-bp-messages-notices-list-table.php

    r13096 r13810  
    9595     */
    9696    public function single_row( $item ) {
    97         $class = '';
    9897
    9998        if ( ! empty( $item->is_active ) ) {
    100             $class = ' class="notice-active"';
     99            echo '<tr class="notice-active">';
     100        } else {
     101            echo '<tr>';
    101102        }
    102103
    103         echo "<tr{$class}>";
    104104        $this->single_row_columns( $item );
    105105        echo '</tr>';
     
    146146        }
    147147
    148         echo '<strong>' . apply_filters( 'bp_get_message_notice_subject', $item->subject ) . '</strong> ' . $this->row_actions( $actions );
     148        echo '<strong>' . esc_html( apply_filters( 'bp_get_message_notice_subject', $item->subject ) ) . '</strong> ';
     149
     150        // BuddyPress relies on WordPress's `WP_List_Table::row_actions()`.
     151        // phpcs:ignore WordPress.Security.EscapeOutput
     152        echo $this->row_actions( $actions );
    149153    }
    150154
     
    157161     */
    158162    public function column_message( $item ) {
     163        // Escaping is made in `bp-messages/bp-messages-filters.php`.
     164        // phpcs:ignore WordPress.Security.EscapeOutput
    159165        echo apply_filters( 'bp_get_message_notice_text', $item->message );
    160166    }
     
    168174     */
    169175    public function column_date_sent( $item ) {
    170         echo apply_filters( 'bp_get_message_notice_post_date', bp_format_time( strtotime( $item->date_sent ) ) );
     176        echo esc_html( apply_filters( 'bp_get_message_notice_post_date', bp_format_time( strtotime( $item->date_sent ) ) ) );
    171177    }
    172178}
Note: See TracChangeset for help on using the changeset viewer.