Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/28/2024 12:23:47 PM (3 years ago)
Author:
imath
Message:

Core: improve PHP code standards using WPCS

See #7228 (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-admin.php

    r13789 r13818  
    803803                                                        /* translators: %s is the placeholder for the BuddyPress version number. */
    804804                                                        esc_html__( 'BuddyPress %s', 'buddypress' ),
    805                                                         $version
     805                                                        esc_html( $version )
    806806                                                ); ?>
    807807                                        </h1>
    … …  
    821821                                                                        /* Translators: %s is a raising hands emoji. */
    822822                                                                        esc_html__( 'You now have complete control over all BuddyPress-generated URLs %s', 'buddypress' ),
     823                                                                        // phpcs:ignore WordPress.Security.EscapeOutput
    823824                                                                        wp_staticize_emoji( '🙌' )
    824825                                                                );
    … …  
    891892                                                                        /* Translators: %s is a woman supervillain emoji. */
    892893                                                                        esc_html__( 'Here\'s another benefit of the BP Rewrites API: the new "members only" community visibility level %s', 'buddypress' ),
     894                                                                        // phpcs:ignore WordPress.Security.EscapeOutput
    893895                                                                        wp_staticize_emoji( 'đŸŠčđŸ»' )
    894896                                                                );
    … …  
    930932                                                                        /* Translators: %s is a smiling face with heart-eyes emoji. */
    931933                                                                        esc_html__( 'Many thanks to you for trusting BuddyPress to power your community site %s', 'buddypress' ),
     934                                                                        // phpcs:ignore WordPress.Security.EscapeOutput
    932935                                                                        wp_staticize_emoji( '😍' )
    933936                                                                );
    … …  
    943946                                        <p>
    944947                                                <?php
    945                                                 printf(
    946                                                         /* translators: 1: heart dashicons. 2: BP Credits screen url. 3: number of BuddyPress contributors to this version. */
    947                                                         _n( 'Built with %1$s by <a href="%2$s">%3$d volunteer</a>.', 'Built with %1$s by <a href="%2$s">%3$d volunteers</a>.', 49, 'buddypress' ),
    948                                                         '<span class="dashicons dashicons-heart"></span>',
    949                                                         esc_url( bp_get_admin_url( 'admin.php?page=bp-credits' ) ),
    950                                                         number_format_i18n( 49 )
     948                                                echo wp_kses(
     949                                                        sprintf(
     950                                                                /* translators: 1: heart dashicons. 2: BP Credits screen url. 3: number of BuddyPress contributors to this version. */
     951                                                                _n( 'Built with %1$s by <a href="%2$s">%3$d volunteer</a>.', 'Built with %1$s by <a href="%2$s">%3$d volunteers</a>.', 49, 'buddypress' ),
     952                                                                '<span class="dashicons dashicons-heart"></span>',
     953                                                                esc_url( bp_get_admin_url( 'admin.php?page=bp-credits' ) ),
     954                                                                esc_html( number_format_i18n( 49 ) )
     955                                                        ),
     956                                                        array(
     957                                                                'a'    => array(
     958                                                                        'href' => true,
     959                                                                ),
     960                                                                'span' => array(
     961                                                                        'class' => true,
     962                                                                )
     963                                                        )
    951964                                                );
    952965                                                ?>
    … …  
    10991112                                        /* translators: %s: BuddyPress version number */
    11001113                                        esc_html__( 'Noteworthy Contributors to %s', 'buddypress' ),
    1101                                         self::display_version()
     1114                                        esc_html( self::display_version() )
    11021115                                );
    11031116                                ?>
    … …  
    11231136                                        /* translators: %s: BuddyPress version number */
    11241137                                        esc_html__( 'All Contributors to BuddyPress %s', 'buddypress' ),
    1125                                         self::display_version()
     1138                                        esc_html( self::display_version() )
    11261139                                );
    11271140                                ?>
    … …  
    12661279
    12671280                if ( is_wp_error( $terms ) || ! $terms  ) {
    1268                         printf( '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">%s</span>', $taxonomy_object->labels->no_terms );
     1281                        printf( '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">%s</span>', esc_html( $taxonomy_object->labels->no_terms ) );
    12691282                } else {
    12701283                        $situations = wp_list_pluck( $terms, 'description' );
    … …  
    12721285                        // Output each situation as a list item.
    12731286                        echo '<ul><li>';
    1274                         echo implode( '</li><li>', $situations );
     1287                        echo implode( '</li><li>', array_map( 'esc_html', $situations ) );
    12751288                        echo '</li></ul>';
    12761289                }
Note: See TracChangeset for help on using the changeset viewer.