Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/29/2024 08:15:44 PM (3 years ago)
Author:
imath
Message:

Deprecated functions: improve PHP code standards using WPCS

See #7228 (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/deprecated/1.5.php

    r13490 r13824  
    148148
    149149<div class="bp-widget wp-profile">
    150         <h4><?php _e( 'My Profile', 'buddypress' ) ?></h4>
     150        <h4><?php esc_html_e( 'My Profile', 'buddypress' ) ?></h4>
    151151
    152152        <table class="wp-profile-fields">
    … …  
    155155
    156156                        <tr id="wp_displayname">
    157                                 <td class="label"><?php _e( 'Name', 'buddypress' ); ?></td>
    158                                 <td class="data"><?php echo $ud->display_name; ?></td>
     157                                <td class="label"><?php esc_html_e( 'Name', 'buddypress' ); ?></td>
     158                                <td class="data"><?php echo esc_html( $ud->display_name ); ?></td>
    159159                        </tr>
    160160
    … …  
    164164
    165165                        <tr id="wp_desc">
    166                                 <td class="label"><?php _e( 'About Me', 'buddypress' ); ?></td>
    167                                 <td class="data"><?php echo $ud->user_description; ?></td>
     166                                <td class="label"><?php esc_html_e( 'About Me', 'buddypress' ); ?></td>
     167                                <td class="data"><?php echo esc_html( $ud->user_description ); ?></td>
    168168                        </tr>
    169169
    … …  
    173173
    174174                        <tr id="wp_website">
    175                                 <td class="label"><?php _e( 'Website', 'buddypress' ); ?></td>
    176                                 <td class="data"><?php echo make_clickable( $ud->user_url ); ?></td>
     175                                <td class="label"><?php esc_html_e( 'Website', 'buddypress' ); ?></td>
     176                                <td class="data">
     177                                        <?php
     178                                        // phpcs:ignore WordPress.Security.EscapeOutput
     179                                        echo make_clickable( esc_url( $ud->user_url ) );
     180                                        ?>
     181                                </td>
    177182                        </tr>
    178183
    … …  
    182187
    183188                        <tr id="wp_jabber">
    184                                 <td class="label"><?php _e( 'Jabber', 'buddypress' ); ?></td>
    185                                 <td class="data"><?php echo $ud->jabber; ?></td>
     189                                <td class="label"><?php esc_html_e( 'Jabber', 'buddypress' ); ?></td>
     190                                <td class="data"><?php echo esc_html( $ud->jabber ); ?></td>
    186191                        </tr>
    187192
    … …  
    191196
    192197                        <tr id="wp_aim">
    193                                 <td class="label"><?php _e( 'AOL Messenger', 'buddypress' ); ?></td>
    194                                 <td class="data"><?php echo $ud->aim; ?></td>
     198                                <td class="label"><?php esc_html_e( 'AOL Messenger', 'buddypress' ); ?></td>
     199                                <td class="data"><?php echo esc_html( $ud->aim ); ?></td>
    195200                        </tr>
    196201
    … …  
    200205
    201206                        <tr id="wp_yim">
    202                                 <td class="label"><?php _e( 'Yahoo Messenger', 'buddypress' ); ?></td>
    203                                 <td class="data"><?php echo $ud->yim; ?></td>
     207                                <td class="label"><?php esc_html_e( 'Yahoo Messenger', 'buddypress' ); ?></td>
     208                                <td class="data"><?php echo esc_html( $ud->yim ); ?></td>
    204209                        </tr>
    205210
    … …  
    283288 */
    284289function bp_page_title() {
     290        // phpcs:ignore WordPress.Security.EscapeOutput
    285291        echo bp_get_page_title();
    286292}
    … …  
    315321        _deprecated_function( __FUNCTION__, '1.5', 'wp_logout_url()' );
    316322
    317         $logout_link = '<a href="' . wp_logout_url( bp_get_root_domain() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a>';
     323        $logout_link = '<a href="' . esc_url( wp_logout_url( bp_get_root_domain() ) ) . '">' . esc_html__( 'Log Out', 'buddypress' ) . '</a>';
     324
     325        // phpcs:ignore WordPress.Security.EscapeOutput
    318326        echo apply_filters( 'bp_logout_link', $logout_link );
    319327}
    … …  
    421429
    422430        $form = '
    423                 <form action="' . bp_search_form_action() . '" method="post" id="search-form">
     431                <form action="' . esc_url( bp_search_form_action() ) . '" method="post" id="search-form">
    424432                        <input type="text" id="search-terms" name="search-terms" value="" />
    425433                        ' . bp_search_form_type_select() . '
    426434
    427                         <input type="submit" name="search-submit" id="search-submit" value="' . __( 'Search', 'buddypress' ) . '" />
     435                        <input type="submit" name="search-submit" id="search-submit" value="' . esc_attr__( 'Search', 'buddypress' ) . '" />
    428436                        ' . wp_nonce_field( 'bp_search_form' ) . '
    429437                </form>
    430438        ';
    431439
     440        // phpcs:ignore WordPress.Security.EscapeOutput
    432441        echo apply_filters( 'bp_search_form', $form );
    433442}
    … …  
    750759
    751760                                <?php
     761                                // phpcs:ignore WordPress.Security.EscapeOutput
    752762                                echo bp_core_fetch_avatar(
    753763                                        array(
    … …  
    767777                                <h5>
    768778
    769                                         <?php echo bp_core_get_userlink( $admin->user_id ); ?>
     779                                        <?php
     780                                        // phpcs:ignore WordPress.Security.EscapeOutput
     781                                        echo bp_core_get_userlink( $admin->user_id );
     782                                        ?>
    770783
    771784                                        <span class="small">
    772                                                 <a class="button confirm admin-demote-to-member" href="<?php bp_group_member_demote_link($admin->user_id) ?>"><?php _e( 'Demote to Member', 'buddypress' ) ?></a>
     785                                                <a class="button confirm admin-demote-to-member" href="<?php bp_group_member_demote_link($admin->user_id) ?>"><?php esc_html_e( 'Demote to Member', 'buddypress' ) ?></a>
    773786                                        </span>
    774787                                </h5>
    … …  
    780793
    781794                                <?php
     795                                // phpcs:ignore WordPress.Security.EscapeOutput
    782796                                echo bp_core_fetch_avatar(
    783797                                        array(
    … …  
    793807                                ?>
    794808
    795                                 <h5><?php echo bp_core_get_userlink( $admin->user_id ) ?></h5>
     809                                <h5>
     810                                        <?php
     811                                        // phpcs:ignore WordPress.Security.EscapeOutput
     812                                        echo bp_core_get_userlink( $admin->user_id );
     813                                        ?>
     814                                </h5>
    796815                                <span class="activity">
    797816                                        <?php
    798817                                        /* translators: %s: human time diff */
    799                                         echo bp_core_get_last_activity( strtotime( $admin->date_modified ), __( 'joined %s', 'buddypress') );
     818                                        echo esc_html( bp_core_get_last_activity( strtotime( $admin->date_modified ), esc_html__( 'joined %s', 'buddypress' ) ) );
    800819                                        ?>
    801820                                </span>
    … …  
    821840
    822841                <div id="message" class="info">
    823                         <p><?php _e( 'This group has no administrators', 'buddypress' ); ?></p>
     842                        <p><?php esc_html_e( 'This group has no administrators', 'buddypress' ); ?></p>
    824843                </div>
    825844
Note: See TracChangeset for help on using the changeset viewer.