Changeset 13799
- Timestamp:
- 04/23/2024 09:39:11 PM (12 months ago)
- Location:
- trunk/src/bp-members
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-admin.php
r13234 r13799 146 146 147 147 ?> 148 <div id="signup-info-modal-<?php echo $signup_object->id; ?>" style="display:none;">148 <div id="signup-info-modal-<?php echo esc_attr( $signup_object->id ); ?>" style="display:none;"> 149 149 <h1><?php printf( '%1$s (%2$s)', esc_html( $signup_object->user_name ), esc_html( $signup_object->user_email ) ); ?></h1> 150 150 … … 166 166 <tr> 167 167 <td class="column-fields"><?php echo esc_html( $signup_field_labels[ $profile_field_id ] ); ?></td> 168 <td><?php echo bp_members_admin_format_xprofile_field_for_display( $field_value ); ?></td> 168 <td> 169 <?php 170 // phpcs:ignore WordPress.Security.EscapeOutput 171 echo bp_members_admin_format_xprofile_field_for_display( $field_value ); 172 ?> 173 </td> 169 174 </tr> 170 175 <?php endforeach; else: ?> -
trunk/src/bp-members/bp-members-blocks.php
r13716 r13799 369 369 ); 370 370 371 // Include the common JS template. 371 // Include the common JS template (Escaping is done there). 372 // phpcs:ignore WordPress.Security.EscapeOutput 372 373 echo bp_get_dynamic_template_part( 'assets/widgets/dynamic-members.php' ); 373 374 -
trunk/src/bp-members/bp-members-functions.php
r13798 r13799 1137 1137 // Don't send the warning more than once per pageload. 1138 1138 if ( false === $warned ) { 1139 _doing_it_wrong( 'get_user_meta( $user_id, \'last_activity\' )', __( 'User last_activity data is no longer stored in usermeta. Use bp_get_user_last_activity() instead.', 'buddypress' ), '2.0.0' );1139 _doing_it_wrong( 'get_user_meta( $user_id, \'last_activity\' )', esc_html__( 'User last_activity data is no longer stored in usermeta. Use bp_get_user_last_activity() instead.', 'buddypress' ), '2.0.0' ); 1140 1140 $warned = true; 1141 1141 } … … 1172 1172 function _bp_update_user_meta_last_activity_warning( $meta_id, $object_id, $meta_key, $meta_value ) { 1173 1173 if ( 'last_activity' === $meta_key ) { 1174 _doing_it_wrong( 'update_user_meta( $user_id, \'last_activity\' )', __( 'User last_activity data is no longer stored in usermeta. Use bp_update_user_last_activity() instead.', 'buddypress' ), '2.0.0' );1174 _doing_it_wrong( 'update_user_meta( $user_id, \'last_activity\' )', esc_html__( 'User last_activity data is no longer stored in usermeta. Use bp_update_user_last_activity() instead.', 'buddypress' ), '2.0.0' ); 1175 1175 bp_update_user_last_activity( $object_id, $meta_value ); 1176 1176 } … … 2686 2686 */ 2687 2687 function bp_member_type_tax_name() { 2688 echo bp_get_member_type_tax_name();2688 echo esc_html( bp_get_member_type_tax_name() ); 2689 2689 } 2690 2690 /** -
trunk/src/bp-members/bp-members-notifications.php
r13433 r13799 241 241 <tr> 242 242 <th class="icon"></th> 243 <th class="title"><?php _ex( 'Members', 'Member settings on notification settings page', 'buddypress' )?></th>244 <th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>245 <th class="no"><?php _e( 'No', 'buddypress' )?></th>243 <th class="title"><?php echo esc_html_x( 'Members', 'Member settings on notification settings page', 'buddypress' ); ?></th> 244 <th class="yes"><?php esc_html_e( 'Yes', 'buddypress' ) ?></th> 245 <th class="no"><?php esc_html_e( 'No', 'buddypress' )?></th> 246 246 </tr> 247 247 </thead> -
trunk/src/bp-members/bp-members-template.php
r13647 r13799 19 19 */ 20 20 function bp_profile_slug() { 21 echo bp_get_profile_slug();21 echo esc_url( bp_get_profile_slug() ); 22 22 } 23 23 /** … … 46 46 */ 47 47 function bp_members_slug() { 48 echo bp_get_members_slug();48 echo esc_url( bp_get_members_slug() ); 49 49 } 50 50 /** … … 73 73 */ 74 74 function bp_members_root_slug() { 75 echo bp_get_members_root_slug();75 echo esc_url( bp_get_members_root_slug() ); 76 76 } 77 77 /** … … 216 216 */ 217 217 function bp_signup_slug() { 218 echo bp_get_signup_slug();218 echo esc_url( bp_get_signup_slug() ); 219 219 } 220 220 /** … … 249 249 */ 250 250 function bp_activate_slug() { 251 echo bp_get_activate_slug();251 echo esc_url( bp_get_activate_slug() ); 252 252 } 253 253 /** … … 282 282 */ 283 283 function bp_members_invitations_slug() { 284 echo bp_get_members_invitations_slug();284 echo esc_url( bp_get_members_invitations_slug() ); 285 285 } 286 286 /** … … 490 490 */ 491 491 function bp_members_pagination_count() { 492 echo bp_get_members_pagination_count();492 echo esc_html( bp_get_members_pagination_count() ); 493 493 } 494 494 /** … … 559 559 */ 560 560 function bp_members_pagination_links() { 561 // Escaping is done in WordPress's `paginate_links()` function. 562 // phpcs:ignore WordPress.Security.EscapeOutput 561 563 echo bp_get_members_pagination_links(); 562 564 } … … 589 591 */ 590 592 function bp_member_user_id() { 591 echo bp_get_member_user_id();593 echo intval( bp_get_member_user_id() ); 592 594 } 593 595 /** … … 625 627 */ 626 628 function bp_member_class( $classes = array() ) { 629 // phpcs:ignore WordPress.Security.EscapeOutput 627 630 echo bp_get_member_class( $classes ); 628 631 } … … 673 676 if ( $member_types = bp_get_member_type( $members_template->member->id, false ) ) { 674 677 foreach ( $member_types as $member_type ) { 675 $classes[] = sprintf( 'member-type-%s', esc_attr( $member_type ));678 $classes[] = sprintf( 'member-type-%s', $member_type ); 676 679 } 677 680 } … … 682 685 * @since 1.7.0 683 686 * 684 * @param string$classes Classes to be added to the HTML element.685 */ 686 $classes = a pply_filters( 'bp_get_member_class', $classes);687 * @param array $classes Classes to be added to the HTML element. 688 */ 689 $classes = array_map( 'sanitize_html_class', apply_filters( 'bp_get_member_class', $classes ) ); 687 690 $classes = array_merge( $classes, array() ); 688 691 $retval = 'class="' . join( ' ', $classes ) . '"'; … … 697 700 */ 698 701 function bp_member_user_nicename() { 699 echo bp_get_member_user_nicename();702 echo esc_html( bp_get_member_user_nicename() ); 700 703 } 701 704 /** … … 727 730 */ 728 731 function bp_member_user_login() { 729 echo bp_get_member_user_login();732 echo esc_html( bp_get_member_user_login() ); 730 733 } 731 734 /** … … 757 760 */ 758 761 function bp_member_user_email() { 759 echo bp_get_member_user_email();762 echo esc_html( bp_get_member_user_email() ); 760 763 } 761 764 /** … … 811 814 */ 812 815 function bp_member_avatar( $args = '' ) { 816 // phpcs:disable WordPress.Security.EscapeOutput 813 817 814 818 /** … … 822 826 */ 823 827 echo apply_filters( 'bp_member_avatar', bp_get_member_avatar( $args ), $args ); 828 // phpcs:enable 824 829 } 825 830 /** … … 950 955 */ 951 956 function bp_member_name() { 957 // phpcs:disable WordPress.Security.EscapeOutput 952 958 953 959 /** … … 959 965 */ 960 966 echo apply_filters( 'bp_member_name', bp_get_member_name() ); 967 // phpcs:enable 961 968 } 962 969 /** … … 1017 1024 */ 1018 1025 function bp_member_last_active( $args = array() ) { 1019 echo bp_get_member_last_active( $args);1026 echo esc_html( bp_get_member_last_active( $args ) ); 1020 1027 } 1021 1028 /** … … 1091 1098 */ 1092 1099 function bp_member_latest_update( $args = '' ) { 1100 // phpcs:ignore WordPress.Security.EscapeOutput 1093 1101 echo bp_get_member_latest_update( $args ); 1094 1102 } … … 1207 1215 */ 1208 1216 function bp_member_profile_data( $args = '' ) { 1217 // phpcs:ignore WordPress.Security.EscapeOutput 1209 1218 echo bp_get_member_profile_data( $args ); 1210 1219 } … … 1315 1324 */ 1316 1325 function bp_member_registered( $args = array() ) { 1317 echo bp_get_member_registered( $args);1326 echo esc_html( bp_get_member_registered( $args ) ); 1318 1327 } 1319 1328 /** … … 1369 1378 */ 1370 1379 function bp_member_random_profile_data() { 1371 if ( bp_is_active( 'xprofile' ) ) { ?> 1372 <?php $random_data = xprofile_get_random_profile_data( bp_get_member_user_id(), true ); ?> 1380 if ( bp_is_active( 'xprofile' ) ) { 1381 $random_data = xprofile_get_random_profile_data( bp_get_member_user_id(), true ); 1382 // phpcs:disable WordPress.Security.EscapeOutput 1383 ?> 1373 1384 <strong><?php echo wp_filter_kses( $random_data[0]->name ) ?></strong> 1374 1385 <?php echo wp_filter_kses( $random_data[0]->value ) ?> 1375 <?php } 1386 <?php 1387 // phpcs:enable 1388 } 1376 1389 } 1377 1390 … … 1414 1427 $search_form_html = '<form action="" method="get" id="search-members-form"> 1415 1428 <label for="members_search"><input type="text" name="' . esc_attr( $query_arg ) . '" id="members_search" placeholder="'. esc_attr( $search_value ) .'" /></label> 1416 <input type="submit" id="members_search_submit" name="members_search_submit" value="' . __( 'Search', 'buddypress' ) . '" />1429 <input type="submit" id="members_search_submit" name="members_search_submit" value="' . esc_html__( 'Search', 'buddypress' ) . '" /> 1417 1430 </form>'; 1418 1431 1419 /** 1420 * Filters the Members component search form. 1421 * 1422 * @since 1.9.0 1423 * 1424 * @param string $search_form_html HTML markup for the member search form. 1425 */ 1426 echo apply_filters( 'bp_directory_members_search_form', $search_form_html ); 1432 // phpcs:ignore WordPress.Security.EscapeOutput 1433 echo apply_filters( 1434 /** 1435 * Filters the Members component search form. 1436 * 1437 * @since 1.9.0 1438 * 1439 * @param string $search_form_html HTML markup for the member search form. 1440 */ 1441 'bp_directory_members_search_form', 1442 $search_form_html 1443 ); 1427 1444 } 1428 1445 … … 1433 1450 */ 1434 1451 function bp_total_site_member_count() { 1435 echo bp_get_total_site_member_count();1452 echo esc_html( bp_get_total_site_member_count() ); 1436 1453 } 1437 1454 /** … … 1502 1519 } 1503 1520 1504 // Echo out the final list item.1505 echo apply_filters_ref_array( 'bp_get_loggedin_user_nav_' . $nav_item->css_id, array( '<li id="li-nav-' . $nav_item->css_id . '" ' . $selected . '><a id="my-' . $nav_item->css_id . '" href="' . $nav_item->link . '">' . $nav_item->name. '</a></li>', &$nav_item ) );1521 // phpcs:ignore WordPress.Security.EscapeOutput 1522 echo apply_filters_ref_array( 'bp_get_loggedin_user_nav_' . $nav_item->css_id, array( '<li id="li-nav-' . esc_attr( $nav_item->css_id ) . '" ' . $selected . '><a id="my-' . esc_attr( $nav_item->css_id ) . '" href="' . esc_url( $nav_item->link ) . '">' . esc_html( $nav_item->name ) . '</a></li>', &$nav_item ) ); 1506 1523 } 1507 1524 1508 1525 // Always add a log out list item to the end of the navigation. 1509 $logout_link = '<li><a id="wp-logout" href="' . wp_logout_url( bp_get_root_url() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>'; 1510 1526 $logout_link = '<li><a id="wp-logout" href="' . esc_url( wp_logout_url( bp_get_root_url() ) ) . '">' . esc_html__( 'Log Out', 'buddypress' ) . '</a></li>'; 1527 1528 // phpcs:ignore WordPress.Security.EscapeOutput 1511 1529 echo apply_filters( 'bp_logout_nav_link', $logout_link ); 1512 1530 } … … 1630 1648 } 1631 1649 1632 /** 1633 * Filters the navigation markup for the displayed user. 1634 * 1635 * This is a dynamic filter that is dependent on the navigation tab component being rendered. 1636 * 1637 * @since 1.1.0 1638 * 1639 * @param string $value Markup for the tab list item including link. 1640 * @param array $user_nav_item Array holding parts used to construct tab list item. 1641 * Passed by reference. 1642 */ 1643 echo apply_filters_ref_array( 'bp_get_displayed_user_nav_' . $user_nav_item->css_id, array( '<li id="' . $user_nav_item->css_id . '-personal-li" ' . $selected . '><a id="user-' . $user_nav_item->css_id . '" href="' . $link . '">' . $user_nav_item->name . '</a></li>', &$user_nav_item ) ); 1650 // phpcs:ignore WordPress.Security.EscapeOutput 1651 echo apply_filters_ref_array( 1652 /** 1653 * Filters the navigation markup for the displayed user. 1654 * 1655 * This is a dynamic filter that is dependent on the navigation tab component being rendered. 1656 * 1657 * @since 1.1.0 1658 * 1659 * @param string $value Markup for the tab list item including link. 1660 * @param array $user_nav_item Array holding parts used to construct tab list item. 1661 * Passed by reference. 1662 */ 1663 'bp_get_displayed_user_nav_' . $user_nav_item->css_id, 1664 array( 1665 '<li id="' . esc_attr( $user_nav_item->css_id ) . '-personal-li" ' . $selected . '><a id="user-' . esc_attr( $user_nav_item->css_id ) . '" href="' . esc_url( $link ) . '">' . wp_kses( $user_nav_item->name, array( 'span' => array( 'class' => true ) ) ) . '</a></li>', 1666 &$user_nav_item 1667 ) 1668 ); 1644 1669 } 1645 1670 } … … 1671 1696 */ 1672 1697 function bp_loggedin_user_avatar( $args = '' ) { 1698 // phpcs:ignore WordPress.Security.EscapeOutput 1673 1699 echo bp_get_loggedin_user_avatar( $args ); 1674 1700 } … … 1730 1756 */ 1731 1757 function bp_displayed_user_avatar( $args = '' ) { 1758 // phpcs:ignore WordPress.Security.EscapeOutput 1732 1759 echo bp_get_displayed_user_avatar( $args ); 1733 1760 } … … 1785 1812 */ 1786 1813 function bp_displayed_user_email() { 1787 echo bp_get_displayed_user_email();1814 echo esc_html( bp_get_displayed_user_email() ); 1788 1815 } 1789 1816 /** … … 1824 1851 */ 1825 1852 function bp_last_activity( $user_id = 0 ) { 1826 echo bp_get_last_activity( $user_id);1853 echo esc_html( bp_get_last_activity( $user_id ) ); 1827 1854 } 1828 1855 /** … … 1861 1888 */ 1862 1889 function bp_user_firstname() { 1863 echo bp_get_user_firstname();1890 echo esc_html( bp_get_user_firstname() ); 1864 1891 } 1865 1892 /** … … 1993 2020 * @param string $url Generated link for the displayed user's profile. 1994 2021 */ 1995 return apply_filters( 'bp_displayed_user_domain', $url );2022 return apply_filters( 'bp_displayed_user_domain', $url ); 1996 2023 } 1997 2024 … … 2089 2116 */ 2090 2117 function bp_displayed_user_fullname() { 2091 echo bp_get_displayed_user_fullname();2118 echo esc_html( bp_get_displayed_user_fullname() ); 2092 2119 } 2093 2120 /** … … 2116 2143 * @since 1.0.0 2117 2144 */ 2118 function bp_user_fullname() { echo bp_get_displayed_user_fullname(); }2145 function bp_user_fullname() { echo esc_html( bp_get_displayed_user_fullname() ); } 2119 2146 2120 2147 … … 2125 2152 */ 2126 2153 function bp_loggedin_user_fullname() { 2127 echo bp_get_loggedin_user_fullname();2154 echo esc_html( bp_get_loggedin_user_fullname() ); 2128 2155 } 2129 2156 /** … … 2153 2180 */ 2154 2181 function bp_displayed_user_username() { 2155 echo bp_get_displayed_user_username();2182 echo esc_html( bp_get_displayed_user_username() ); 2156 2183 } 2157 2184 /** … … 2187 2214 */ 2188 2215 function bp_loggedin_user_username() { 2189 echo bp_get_loggedin_user_username();2216 echo esc_html( bp_get_loggedin_user_username() ); 2190 2217 } 2191 2218 /** … … 2221 2248 */ 2222 2249 function bp_current_member_type_message() { 2223 echo bp_get_current_member_type_message();2250 echo wp_kses( bp_get_current_member_type_message(), array( 'strong' => true ) ); 2224 2251 } 2225 2252 /** … … 2254 2281 */ 2255 2282 function bp_member_type_directory_link( $member_type = '' ) { 2283 // phpcs:ignore WordPress.Security.EscapeOutput 2256 2284 echo bp_get_member_type_directory_link( $member_type ); 2257 2285 } … … 2302 2330 */ 2303 2331 function bp_member_type_list( $user_id = 0, $r = array() ) { 2332 // phpcs:ignore WordPress.Security.EscapeOutput 2304 2333 echo bp_get_member_type_list( $user_id, $r ); 2305 2334 } … … 2577 2606 */ 2578 2607 function bp_signup_username_value() { 2579 echo bp_get_signup_username_value();2608 echo esc_html( bp_get_signup_username_value() ); 2580 2609 } 2581 2610 /** … … 2609 2638 */ 2610 2639 function bp_signup_email_value() { 2611 echo bp_get_signup_email_value();2640 echo esc_html( bp_get_signup_email_value() ); 2612 2641 } 2613 2642 /** … … 2647 2676 */ 2648 2677 function bp_signup_with_blog_value() { 2649 echo bp_get_signup_with_blog_value();2678 echo intval( bp_get_signup_with_blog_value() ); 2650 2679 } 2651 2680 /** … … 2677 2706 */ 2678 2707 function bp_signup_blog_url_value() { 2679 echo bp_get_signup_blog_url_value();2708 echo esc_url( bp_get_signup_blog_url_value() ); 2680 2709 } 2681 2710 /** … … 2709 2738 */ 2710 2739 function bp_signup_subdomain_base() { 2711 echo bp_signup_get_subdomain_base();2740 echo esc_url( bp_signup_get_subdomain_base() ); 2712 2741 } 2713 2742 /** … … 2745 2774 */ 2746 2775 function bp_signup_blog_title_value() { 2747 echo bp_get_signup_blog_title_value();2776 echo esc_html( bp_get_signup_blog_title_value() ); 2748 2777 } 2749 2778 /** … … 2777 2806 */ 2778 2807 function bp_signup_blog_privacy_value() { 2779 echo bp_get_signup_blog_privacy_value();2808 echo esc_html( bp_get_signup_blog_privacy_value() ); 2780 2809 } 2781 2810 /** … … 2809 2838 */ 2810 2839 function bp_signup_avatar_dir_value() { 2811 echo bp_get_signup_avatar_dir_value();2840 echo esc_html( bp_get_signup_avatar_dir_value() ); 2812 2841 } 2813 2842 /** … … 2822 2851 2823 2852 // Check if signup_avatar_dir is passed. 2824 if ( ! empty( $_POST['signup_avatar_dir'] ) )2853 if ( ! empty( $_POST['signup_avatar_dir'] ) ) { 2825 2854 $signup_avatar_dir = $_POST['signup_avatar_dir']; 2826 2855 2827 // If not, check if global is set.2828 elseif ( !empty( $bp->signup->avatar_dir ) )2856 // If not, check if global is set. 2857 } elseif ( ! empty( $bp->signup->avatar_dir ) ) { 2829 2858 $signup_avatar_dir = $bp->signup->avatar_dir; 2830 2859 2831 // If not, set false.2832 else2860 // If not, set false. 2861 } else { 2833 2862 $signup_avatar_dir = false; 2863 } 2834 2864 2835 2865 /** … … 2872 2902 */ 2873 2903 function bp_current_signup_step() { 2874 echo bp_get_current_signup_step();2904 echo esc_html( bp_get_current_signup_step() ); 2875 2905 } 2876 2906 /** … … 2895 2925 */ 2896 2926 function bp_signup_avatar( $args = '' ) { 2927 // phpcs:ignore WordPress.Security.EscapeOutput 2897 2928 echo bp_get_signup_avatar( $args ); 2898 2929 } … … 2924 2955 ); 2925 2956 2926 extract( $r, EXTR_SKIP );2927 2928 2957 $signup_avatar_dir = bp_get_signup_avatar_dir_value(); 2929 2958 … … 2935 2964 'avatar_dir' => 'avatars/signups', 2936 2965 'type' => 'full', 2937 'width' => $ size,2938 'height' => $ size,2939 'alt' => $ alt,2940 'class' => $ class,2966 'width' => $r['size'], 2967 'height' => $r['size'], 2968 'alt' => $r['alt'], 2969 'class' => $r['class'], 2941 2970 ) ); 2942 2971 … … 2962 2991 $gravatar_url = apply_filters( 'bp_gravatar_url', '//www.gravatar.com/avatar/' ); 2963 2992 $md5_lcase_email = md5( strtolower( bp_get_signup_email_value() ) ); 2964 $gravatar_img = '<img src="' . $gravatar_url . $md5_lcase_email . '?d=' . $default_grav . '&s=' . $ size . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="' . $class. '" />';2993 $gravatar_img = '<img src="' . $gravatar_url . $md5_lcase_email . '?d=' . $default_grav . '&s=' . $r['size'] . '" width="' . esc_attr( $r['size'] ) . '" height="' . esc_attr( $r['size'] ) . '" alt="' . esc_attr( $r['alt'] ) . '" class="' . esc_attr( $r['class'] ) . '" />'; 2965 2994 } 2966 2995 … … 2984 3013 */ 2985 3014 function bp_signup_allowed() { 3015 // phpcs:ignore WordPress.Security.EscapeOutput 2986 3016 echo bp_get_signup_allowed(); 2987 3017 } … … 3081 3111 */ 3082 3112 function bp_members_activity_feed() { 3083 if ( !bp_is_active( 'activity' ) || !bp_is_user() ) 3084 return; ?> 3085 3086 <link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' ) ?> | <?php bp_displayed_user_fullname() ?> | <?php _e( 'Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_member_activity_feed_link() ?>" /> 3087 3088 <?php 3113 if ( ! bp_is_active( 'activity' ) || ! bp_is_user() ) { 3114 return; 3115 } 3116 // phpcs:disable WordPress.Security.EscapeOutput 3117 ?> 3118 <link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' ) ?> | <?php bp_displayed_user_fullname() ?> | <?php esc_attr_e( 'Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_member_activity_feed_link() ?>" /> 3119 <?php 3120 // phpcs:enable 3089 3121 } 3090 3122 add_action( 'bp_head', 'bp_members_activity_feed' ); … … 3170 3202 */ 3171 3203 function bp_avatar_delete_link() { 3172 echo bp_get_avatar_delete_link();3204 echo esc_url( bp_get_avatar_delete_link() ); 3173 3205 } 3174 3206 /** … … 3312 3344 */ 3313 3345 function bp_members_invitations_pagination_count() { 3314 echo bp_get_members_invitations_pagination_count();3346 echo esc_html( bp_get_members_invitations_pagination_count() ); 3315 3347 } 3316 3348 /** … … 3352 3384 */ 3353 3385 function bp_members_invitations_pagination_links() { 3386 // phpcs:ignore WordPress.Security.EscapeOutput 3354 3387 echo bp_get_members_invitations_pagination_links(); 3355 3388 } … … 3388 3421 } 3389 3422 3390 /** 3391 * Use this filter to sanitize the output. 3392 * 3393 * @since 8.0.0 3394 * 3395 * @param int|string $value The value for the requested property. 3396 * @param string $property The name of the requested property. 3397 * @param string $context The context of display. 3398 */ 3399 echo apply_filters( 'bp_the_members_invitation_property', bp_get_the_members_invitation_property( $property ), $property, $context ); 3423 // phpcs:ignore WordPress.Security.EscapeOutput 3424 echo apply_filters( 3425 /** 3426 * Use this filter to sanitize the output. 3427 * 3428 * @since 8.0.0 3429 * 3430 * @param int|string $value The value for the requested property. 3431 * @param string $property The name of the requested property. 3432 * @param string $context The context of display. 3433 */ 3434 'bp_the_members_invitation_property', 3435 bp_get_the_members_invitation_property( $property ), 3436 $property, 3437 $context 3438 ); 3400 3439 } 3401 3440 /** … … 3452 3491 */ 3453 3492 function bp_the_members_invitation_action_links( $args = '' ) { 3493 // phpcs:ignore WordPress.Security.EscapeOutput 3454 3494 echo bp_get_the_members_invitation_action_links( $args ); 3455 3495 } … … 3508 3548 */ 3509 3549 function bp_the_members_invitations_resend_link( $user_id = 0 ) { 3550 // phpcs:ignore WordPress.Security.EscapeOutput 3510 3551 echo bp_get_the_members_invitation_delete_link( $user_id ); 3511 3552 } … … 3527 3568 } 3528 3569 3529 $retval = sprintf( '<a href="%1$s" class="resend secondary confirm bp-tooltip">%2$s</a>', esc_url( bp_get_the_members_invitations_resend_url( $user_id ) ), __( 'Resend', 'buddypress' ) );3570 $retval = sprintf( '<a href="%1$s" class="resend secondary confirm bp-tooltip">%2$s</a>', esc_url( bp_get_the_members_invitations_resend_url( $user_id ) ), esc_html__( 'Resend', 'buddypress' ) ); 3530 3571 3531 3572 /** … … 3599 3640 */ 3600 3641 function bp_the_members_invitations_delete_link( $user_id = 0 ) { 3642 // phpcs:ignore WordPress.Security.EscapeOutput 3601 3643 echo bp_get_the_members_invitation_delete_link( $user_id ); 3602 3644 } … … 3696 3738 */ 3697 3739 function bp_members_invitations_list_invites_permalink( $user_id = 0 ) { 3698 echo bp_get_members_invitations_list_invites_permalink( $user_id);3740 echo esc_url( bp_get_members_invitations_list_invites_permalink( $user_id ) ); 3699 3741 } 3700 3742 /** … … 3734 3776 */ 3735 3777 function bp_members_invitations_send_invites_permalink( $user_id = 0 ) { 3736 echo bp_get_members_invitations_send_invites_permalink( $user_id);3778 echo esc_url( bp_get_members_invitations_send_invites_permalink( $user_id ) ); 3737 3779 } 3738 3780 /** -
trunk/src/bp-members/bp-members-widgets.php
r13481 r13799 12 12 defined( 'ABSPATH' ) || exit; 13 13 14 _deprecated_file( basename( __FILE__ ), '12.0.0', '', __( 'BuddyPress does not include Legacy Widgets anymore, you can restore it using the BP Classic plugin', 'buddypress' ) );14 _deprecated_file( basename( __FILE__ ), '12.0.0', '', esc_html__( 'BuddyPress does not include Legacy Widgets anymore, you can restore it using the BP Classic plugin', 'buddypress' ) ); -
trunk/src/bp-members/classes/class-bp-core-members-template.php
r13414 r13799 128 128 // Backward compatibility with old method of passing arguments. 129 129 if ( ! is_array( $args[0] ) || count( $args ) > 1 ) { 130 _deprecated_argument( __METHOD__, '7.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );130 _deprecated_argument( __METHOD__, '7.0.0', sprintf( esc_html__( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); 131 131 132 132 $old_args_keys = array( -
trunk/src/bp-members/classes/class-bp-core-members-widget.php
r13481 r13799 12 12 defined( 'ABSPATH' ) || exit; 13 13 14 _deprecated_file( basename( __FILE__ ), '12.0.0', '', __( 'BuddyPress does not include Legacy Widgets anymore, you can restore it using the BP Classic plugin', 'buddypress' ) );14 _deprecated_file( basename( __FILE__ ), '12.0.0', '', esc_html__( 'BuddyPress does not include Legacy Widgets anymore, you can restore it using the BP Classic plugin', 'buddypress' ) ); 15 15 16 16 /** -
trunk/src/bp-members/classes/class-bp-core-recently-active-widget.php
r13481 r13799 12 12 defined( 'ABSPATH' ) || exit; 13 13 14 _deprecated_file( basename( __FILE__ ), '12.0.0', '', __( 'BuddyPress does not include Legacy Widgets anymore, you can restore it using the BP Classic plugin', 'buddypress' ) );14 _deprecated_file( basename( __FILE__ ), '12.0.0', '', esc_html__( 'BuddyPress does not include Legacy Widgets anymore, you can restore it using the BP Classic plugin', 'buddypress' ) ); 15 15 16 16 /** -
trunk/src/bp-members/classes/class-bp-core-whos-online-widget.php
r13481 r13799 12 12 defined( 'ABSPATH' ) || exit; 13 13 14 _deprecated_file( basename( __FILE__ ), '12.0.0', '', __( 'BuddyPress does not include Legacy Widgets anymore, you can restore it using the BP Classic plugin', 'buddypress' ) );14 _deprecated_file( basename( __FILE__ ), '12.0.0', '', esc_html__( 'BuddyPress does not include Legacy Widgets anymore, you can restore it using the BP Classic plugin', 'buddypress' ) ); 15 15 16 16 /** -
trunk/src/bp-members/classes/class-bp-members-admin.php
r13795 r13799 923 923 if ( current_user_can( 'edit_user', $user->ID ) ) : ?> 924 924 925 <a class="nav-tab<?php echo esc_attr( $wp_active ); ?>" href="<?php echo esc_url( $wordpress_url );?>"><?php _e( 'Profile', 'buddypress' ); ?></a>925 <a class="nav-tab<?php echo esc_attr( $wp_active ); ?>" href="<?php echo esc_url( $wordpress_url );?>"><?php esc_html_e( 'Profile', 'buddypress' ); ?></a> 926 926 927 927 <?php endif; ?> 928 928 929 <a class="nav-tab<?php echo esc_attr( $bp_active ); ?>" href="<?php echo esc_url( $community_url );?>"><?php _e( 'Extended Profile', 'buddypress' ); ?></a>929 <a class="nav-tab<?php echo esc_attr( $bp_active ); ?>" href="<?php echo esc_url( $community_url );?>"><?php esc_html_e( 'Extended Profile', 'buddypress' ); ?></a> 930 930 </h2> 931 931 … … 950 950 // Can current user edit this profile? 951 951 if ( ! $this->member_can_edit( $user_id ) ) { 952 wp_die( __( 'You cannot edit the requested user.', 'buddypress' ) );952 wp_die( esc_html__( 'You cannot edit the requested user.', 'buddypress' ) ); 953 953 } 954 954 … … 1248 1248 <?php else : ?> 1249 1249 1250 <p><?php 1250 <p> 1251 <?php 1251 1252 printf( 1252 1253 '%1$s <a href="%2$s">%3$s</a>', 1253 __( 'No user found with this ID.', 'buddypress' ),1254 esc_html__( 'No user found with this ID.', 'buddypress' ), 1254 1255 esc_url( bp_get_admin_url( 'users.php' ) ), 1255 __( 'Go back and try again.', 'buddypress' )1256 esc_html__( 'Go back and try again.', 'buddypress' ) 1256 1257 ); 1257 ?></p> 1258 ?> 1259 </p> 1258 1260 1259 1261 <?php endif; ?> … … 1325 1327 <?php 1326 1328 /* translators: %s: registration date */ 1327 printf( __( 'Registered on: %s', 'buddypress' ), '<strong>' . $date. '</strong>' );1329 printf( esc_html__( 'Registered on: %s', 'buddypress' ), '<strong>' . esc_html( $date ) . '</strong>' ); 1328 1330 ?> 1329 1331 </span> … … 1360 1362 <?php 1361 1363 /* translators: %s: member name */ 1362 printf( __( '%s has been marked as a spammer. All BuddyPress data associated with the user has been removed', 'buddypress' ), esc_html( bp_core_get_user_displayname( $user->ID ) ) );1364 printf( esc_html__( '%s has been marked as a spammer. All BuddyPress data associated with the user has been removed', 'buddypress' ), esc_html( bp_core_get_user_displayname( $user->ID ) ) ); 1363 1365 ?> 1364 1366 </p> … … 1396 1398 <?php 1397 1399 /* translators: %s: date */ 1398 printf( __( 'Last active: %1$s', 'buddypress' ), '<strong>' . $date. '</strong>' );1400 printf( esc_html__( 'Last active: %1$s', 'buddypress' ), '<strong>' . esc_html( $date ) . '</strong>' ); 1399 1401 ?> 1400 1402 </li> … … 1435 1437 <div class="avatar"> 1436 1438 1437 <?php echo bp_core_fetch_avatar( array( 1438 'item_id' => $user->ID, 1439 'object' => 'user', 1440 'type' => 'full', 1441 'title' => $user->display_name 1442 ) ); ?> 1439 <?php 1440 // Escaping is done in `bp_core_fetch_avatar()`. 1441 // phpcs:ignore WordPress.Security.EscapeOutput 1442 echo bp_core_fetch_avatar( 1443 array( 1444 'item_id' => $user->ID, 1445 'object' => 'user', 1446 'type' => 'full', 1447 'title' => $user->display_name 1448 ) 1449 ); 1450 ?> 1443 1451 1444 1452 <?php if ( bp_get_user_has_avatar( $user->ID ) ) : … … 2171 2179 $notice = array( 2172 2180 'class' => 'error', 2173 'message' => esc_html__( 'There was a problem sending the activation emails. Please try again.', 'buddypress' ),2181 'message' => __( 'There was a problem sending the activation emails. Please try again.', 'buddypress' ), 2174 2182 ); 2175 2183 break; … … 2178 2186 $notice = array( 2179 2187 'class' => 'error', 2180 'message' => esc_html__( 'There was a problem activating accounts. Please try again.', 'buddypress' ),2188 'message' => __( 'There was a problem activating accounts. Please try again.', 'buddypress' ), 2181 2189 ); 2182 2190 break; … … 2185 2193 $notice = array( 2186 2194 'class' => 'error', 2187 'message' => esc_html__( 'There was a problem deleting sign-ups. Please try again.', 'buddypress' ),2195 'message' => __( 'There was a problem deleting sign-ups. Please try again.', 'buddypress' ), 2188 2196 ); 2189 2197 break; … … 2225 2233 <?php endif; ?> 2226 2234 2227 <p><?php echo $notice['message']; ?></p>2235 <p><?php echo esc_html( $notice['message'] ); ?></p> 2228 2236 2229 2237 <?php if ( ! empty( $_REQUEST['notactivated'] ) || ! empty( $_REQUEST['notdeleted'] ) || ! empty( $_REQUEST['notsent'] ) ) :?> … … 2307 2315 2308 2316 <div class="wrap"> 2309 <h1 class="wp-heading-inline"><?php _e( 'Users', 'buddypress' ); ?></h1>2317 <h1 class="wp-heading-inline"><?php esc_html_e( 'Users', 'buddypress' ); ?></h1> 2310 2318 2311 2319 <?php if ( current_user_can( 'create_users' ) ) : ?> … … 2320 2328 2321 2329 if ( $usersearch ) { 2322 printf( '<span class="subtitle">' . __( 'Search results for “%s”', 'buddypress' ) . '</span>', esc_html( $usersearch ) );2330 printf( '<span class="subtitle">' . esc_html__( 'Search results for “%s”', 'buddypress' ) . '</span>', esc_html( $usersearch ) ); 2323 2331 } 2324 2332 ?> … … 2493 2501 <tr> 2494 2502 <td class="column-fields"><?php esc_html_e( 'Email', 'buddypress' ); ?></td> 2495 <td><?php echo sanitize_email( $signup->user_email ); ?></td>2503 <td><?php echo esc_html( $signup->user_email ); ?></td> 2496 2504 </tr> 2497 2505 … … 2501 2509 <tr> 2502 2510 <td class="column-fields"><?php echo esc_html( $fdata[ $pid ] ); ?></td> 2503 <td><?php echo bp_members_admin_format_xprofile_field_for_display( $field_value ); ?></td> 2511 <td> 2512 <?php 2513 // phpcs:ignore WordPress.Security.EscapeOutput 2514 echo bp_members_admin_format_xprofile_field_for_display( $field_value ); 2515 ?> 2516 </td> 2504 2517 </tr> 2505 2518 … … 2540 2553 <?php 2541 2554 /* translators: %s: notification date */ 2542 printf( esc_html__( 'Last notified: %s', 'buddypress'), $last_notified);2555 printf( esc_html__( 'Last notified: %s', 'buddypress'), esc_html( $last_notified ) ); 2543 2556 ?> 2544 2557 … … 2595 2608 $id_name = 'bottom' === $which ? 'bp_change_type2' : 'bp_change_type'; 2596 2609 2597 $types = bp_get_member_types( array(), 'objects' ); ?> 2598 2599 <label class="screen-reader-text" for="<?php echo $id_name; ?>"><?php _e( 'Change member type to…', 'buddypress' ) ?></label> 2610 $types = bp_get_member_types( array(), 'objects' ); 2611 2612 // phpcs:disable WordPress.Security.EscapeOutput 2613 ?> 2614 <label class="screen-reader-text" for="<?php echo $id_name; ?>"><?php esc_html_e( 'Change member type to…', 'buddypress' ) ?></label> 2600 2615 <select name="<?php echo $id_name; ?>" id="<?php echo $id_name; ?>" style="display:inline-block;float:none;"> 2601 <option value=""><?php _e( 'Change member type to…', 'buddypress' ) ?></option>2616 <option value=""><?php esc_html_e( 'Change member type to…', 'buddypress' ) ?></option> 2602 2617 2603 2618 <?php foreach( $types as $type ) : ?> … … 2607 2622 <?php endforeach; ?> 2608 2623 2609 <option value="remove_member_type"><?php _e( 'No Member Type', 'buddypress' ) ?></option>2624 <option value="remove_member_type"><?php esc_html_e( 'No Member Type', 'buddypress' ) ?></option> 2610 2625 2611 2626 </select> 2612 2627 <?php 2628 // phpcs:enable 2629 2613 2630 wp_nonce_field( 'bp-bulk-users-change-type-' . bp_loggedin_user_id(), 'bp-bulk-users-change-type-nonce' ); 2614 2631 submit_button( __( 'Change', 'buddypress' ), 'button', 'bp_change_member_type', false ); … … 3133 3150 <?php endif; ?> 3134 3151 3135 <p><?php echo $notice['message']; ?></p>3152 <p><?php echo esc_html( $notice['message'] ); ?></p> 3136 3153 </div> 3137 3154 … … 3209 3226 <?php 3210 3227 if ( $usersearch ) { 3211 printf( '<span class="subtitle">' . __( 'Search results for “%s”', 'buddypress' ) . '</span>', esc_html( $usersearch ) );3228 printf( '<span class="subtitle">' . esc_html__( 'Search results for “%s”', 'buddypress' ) . '</span>', esc_html( $usersearch ) ); 3212 3229 } 3213 3230 ?> … … 3347 3364 <?php 3348 3365 /* translators: %s: notification date */ 3349 printf( esc_html__( 'Last notified: %s', 'buddypress'), $last_notified);3366 printf( esc_html__( 'Last notified: %s', 'buddypress'), esc_html( $last_notified ) ); 3350 3367 ?> 3351 3368 </p> -
trunk/src/bp-members/classes/class-bp-members-invitations-list-table.php
r13469 r13799 259 259 ); 260 260 261 /* translators: %s: url to site settings */ 262 printf( __( 'Invitations are not allowed. %s', 'buddypress' ), $link ); 261 printf( 262 /* translators: %s: url to site settings */ 263 esc_html__( 'Invitations are not allowed. %s', 'buddypress' ), 264 // The link has been escaped at line 255. 265 // phpcs:ignore WordPress.Security.EscapeOutput 266 $link 267 ); 263 268 } 264 269 … … 288 293 $style = ''; 289 294 foreach ( $this->items as $invite ) { 290 $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"'; 295 $style = 'alt' === $style ? '' : 'alt'; 296 297 // Escapes are made into `self::single_row()`. 298 // phpcs:ignore WordPress.Security.EscapeOutput 291 299 echo "\n\t" . $this->single_row( $invite, $style ); 292 300 } … … 307 315 */ 308 316 public function single_row( $invite = null, $style = '', $role = '', $numposts = 0 ) { 309 echo '<tr' . $style . ' id="invitation-' . esc_attr( $invite->id ) . '">'; 317 if ( '' === $style ) { 318 echo '<tr id="signup-' . esc_attr( $invite->id ) . '">'; 319 } else { 320 echo '<tr class="alternate" id="signup-' . esc_attr( $invite->id ) . '">'; 321 } 322 323 // BuddyPress relies on WordPress's `WP_Users_List_Table::single_row_columns()`. 324 // phpcs:ignore WordPress.Security.EscapeOutput 310 325 echo $this->single_row_columns( $invite ); 311 326 echo '</tr>'; … … 324 339 <?php 325 340 /* translators: accessibility text */ 326 printf( esc_html__( 'Select invitation: %s', 'buddypress' ), $invite->id);341 printf( esc_html__( 'Select invitation: %s', 'buddypress' ), intval( $invite->id ) ); 327 342 ?> 328 343 </label> … … 396 411 $actions = apply_filters( 'bp_members_invitations_management_row_actions', $actions, $invite ); 397 412 413 // BuddyPress relies on WordPress's `WP_Users_List_Table::row_actions()`. 414 // phpcs:ignore WordPress.Security.EscapeOutput 398 415 echo $this->row_actions( $actions ); 399 416 } … … 426 443 $user_link = bp_members_get_user_url( $invite->inviter_id ); 427 444 428 printf( '%1$s <strong><a href="%2$s" class="edit">%3$s</a></strong><br/>', $avatar, esc_url( $user_link ), esc_html( $inviter->user_login ) ); 445 printf( 446 '%1$s <strong><a href="%2$s" class="edit">%3$s</a></strong><br/>', 447 wp_kses( 448 $avatar, 449 array( 450 'img' => array( 451 'alt' => true, 452 'src' => true, 453 'srcset' => true, 454 'class' => true, 455 'height' => true, 456 'width' => true, 457 ) 458 ) 459 ), 460 esc_url( $user_link ), 461 esc_html( $inviter->user_login ) 462 ); 429 463 } 430 464 -
trunk/src/bp-members/classes/class-bp-members-list-table.php
r13499 r13799 216 216 } 217 217 218 /* translators: %s: url to site settings */ 219 printf( __( 'Registration is disabled. %s', 'buddypress' ), $link ); 218 printf( 219 /* translators: %s: url to site settings */ 220 esc_html__( 'Registration is disabled. %s', 'buddypress' ), 221 // The link has been escaped at line 213 & 215. 222 // phpcs:ignore WordPress.Security.EscapeOutput 223 $link 224 ); 220 225 } 221 226 … … 249 254 } 250 255 251 $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"'; 256 $style = 'alt' === $style ? '' : 'alt'; 257 258 // Escapes are made into `self::single_row()`. 259 // phpcs:ignore WordPress.Security.EscapeOutput 252 260 echo "\n\t" . $this->single_row( $signup_object, $style ); 253 261 } … … 268 276 */ 269 277 public function single_row( $signup_object = null, $style = '', $role = '', $numposts = 0 ) { 270 echo '<tr' . $style . ' id="signup-' . esc_attr( $signup_object->id ) . '">'; 278 if ( '' === $style ) { 279 echo '<tr id="signup-' . esc_attr( $signup_object->id ) . '">'; 280 } else { 281 echo '<tr class="alternate" id="signup-' . esc_attr( $signup_object->id ) . '">'; 282 } 283 284 // BuddyPress relies on WordPress's `WP_Users_List_Table::single_row_columns()`. 285 // phpcs:ignore WordPress.Security.EscapeOutput 271 286 echo $this->single_row_columns( $signup_object ); 272 287 echo '</tr>'; … … 282 297 public function column_cb( $signup_object = null ) { 283 298 ?> 284 <label class="screen-reader-text" for="signup_<?php echo intval( $signup_object->id ); ?>"><?php 285 /* translators: accessibility text */ 286 printf( esc_html__( 'Select user: %s', 'buddypress' ), $signup_object->user_login ); 287 ?></label> 299 <label class="screen-reader-text" for="signup_<?php echo intval( $signup_object->id ); ?>"> 300 <?php 301 printf( 302 /* translators: accessibility text */ 303 esc_html__( 'Select user: %s', 'buddypress' ), 304 esc_html( $signup_object->user_login ) 305 ); 306 ?> 307 </label> 288 308 <input type="checkbox" id="signup_<?php echo intval( $signup_object->id ) ?>" name="allsignups[]" value="<?php echo esc_attr( $signup_object->id ) ?>" /> 289 309 <?php … … 330 350 ); 331 351 332 echo $avatar . sprintf( '<strong><a href="%1$s" class="edit">%2$s</a></strong><br/>', esc_url( $activate_link ), $signup_object->user_login ); 352 echo wp_kses( 353 $avatar, 354 array( 355 'img' => array( 356 'alt' => true, 357 'src' => true, 358 'srcset' => true, 359 'class' => true, 360 'height' => true, 361 'width' => true, 362 ) 363 ) 364 ); 365 printf( '<strong><a href="%1$s" class="edit">%2$s</a></strong><br/>', esc_url( $activate_link ), esc_html( $signup_object->user_login ) ); 333 366 334 367 $actions = array(); 335 368 336 $actions['activate'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $activate_link ), __( 'Activate', 'buddypress' ) );337 $actions['resend'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link ), __( 'Email', 'buddypress' ) );369 $actions['activate'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $activate_link ), esc_html__( 'Activate', 'buddypress' ) ); 370 $actions['resend'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link ), esc_html__( 'Email', 'buddypress' ) ); 338 371 339 372 if ( current_user_can( 'delete_users' ) ) { 340 $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), __( 'Delete', 'buddypress' ) );373 $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), esc_html__( 'Delete', 'buddypress' ) ); 341 374 } 342 375 … … 351 384 $actions = apply_filters( 'bp_members_ms_signup_row_actions', $actions, $signup_object ); 352 385 386 // BuddyPress relies on WordPress's `WP_Users_List_Table::row_actions()`. 387 // phpcs:ignore WordPress.Security.EscapeOutput 353 388 echo $this->row_actions( $actions ); 354 389 } … … 407 442 */ 408 443 public function column_registered( $signup_object = null ) { 409 echo mysql2date( 'Y/m/d g:i:s a', $signup_object->registered);444 echo esc_html( mysql2date( 'Y/m/d g:i:s a', $signup_object->registered ) ); 410 445 } 411 446 … … 419 454 public function column_date_sent( $signup_object = null ) { 420 455 if ( $signup_object->count_sent > 0 ) { 421 echo mysql2date( 'Y/m/d g:i:s a', $signup_object->date_sent);456 echo esc_html( mysql2date( 'Y/m/d g:i:s a', $signup_object->date_sent ) ); 422 457 } else { 423 $message = __( 'Not yet notified', 'buddypress' );458 $message = esc_html__( 'Not yet notified', 'buddypress' ); 424 459 425 460 /** -
trunk/src/bp-members/classes/class-bp-members-ms-list-table.php
r13499 r13799 205 205 } 206 206 207 /* translators: %s: url to site settings */ 208 printf( __( 'Registration is disabled. %s', 'buddypress' ), $link ); 207 printf( 208 /* translators: %s: url to site settings */ 209 esc_html__( 'Registration is disabled. %s', 'buddypress' ), 210 // The link has been escaped at line 204. 211 // phpcs:ignore WordPress.Security.EscapeOutput 212 $link 213 ); 209 214 } 210 215 } … … 237 242 } 238 243 239 $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"'; 244 $style = 'alt' === $style ? '' : 'alt'; 245 246 // Escapes are made into `self::single_row()`. 247 // phpcs:ignore WordPress.Security.EscapeOutput 240 248 echo "\n\t" . $this->single_row( $signup_object, $style ); 241 249 } … … 253 261 */ 254 262 public function single_row( $signup_object = null, $style = '' ) { 255 echo '<tr' . $style . ' id="signup-' . esc_attr( $signup_object->id ) . '">'; 263 if ( '' === $style ) { 264 echo '<tr id="signup-' . esc_attr( $signup_object->id ) . '">'; 265 } else { 266 echo '<tr class="alternate" id="signup-' . esc_attr( $signup_object->id ) . '">'; 267 } 268 269 // BuddyPress relies on WordPress's `WP_MS_Users_List_Table::single_row_columns()`. 270 // phpcs:ignore WordPress.Security.EscapeOutput 256 271 echo $this->single_row_columns( $signup_object ); 257 272 echo '</tr>'; … … 281 296 public function column_cb( $signup_object = null ) { 282 297 ?> 283 <label class="screen-reader-text" for="signup_<?php echo intval( $signup_object->id ); ?>"><?php printf( 284 /* translators: accessibility text */ 285 esc_html__( 'Select user: %s', 'buddypress' ), $signup_object->user_login ); 286 ?></label> 298 <label class="screen-reader-text" for="signup_<?php echo intval( $signup_object->id ); ?>"> 299 <?php 300 printf( 301 /* translators: accessibility text */ 302 esc_html__( 'Select user: %s', 'buddypress' ), 303 esc_html( $signup_object->user_login ) 304 ); 305 ?> 306 </label> 287 307 <input type="checkbox" id="signup_<?php echo intval( $signup_object->id ) ?>" name="allsignups[]" value="<?php echo esc_attr( $signup_object->id ) ?>" /> 288 308 <?php … … 329 349 ); 330 350 331 echo $avatar . sprintf( '<strong><a href="%1$s" class="edit">%2$s</a></strong><br/>', esc_url( $activate_link ), $signup_object->user_login ); 351 echo wp_kses( 352 $avatar, 353 array( 354 'img' => array( 355 'alt' => true, 356 'src' => true, 357 'srcset' => true, 358 'class' => true, 359 'height' => true, 360 'width' => true, 361 ) 362 ) 363 ); 364 printf( '<strong><a href="%1$s" class="edit">%2$s</a></strong><br/>', esc_url( $activate_link ), esc_html( $signup_object->user_login ) ); 332 365 333 366 $actions = array(); 334 367 335 $actions['activate'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $activate_link ), __( 'Activate', 'buddypress' ) );336 $actions['resend'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link ), __( 'Email', 'buddypress' ) );368 $actions['activate'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $activate_link ), esc_html__( 'Activate', 'buddypress' ) ); 369 $actions['resend'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link ), esc_html__( 'Email', 'buddypress' ) ); 337 370 338 371 if ( current_user_can( 'delete_users' ) ) { 339 $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), __( 'Delete', 'buddypress' ) );372 $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), esc_html__( 'Delete', 'buddypress' ) ); 340 373 } 341 374 … … 343 376 $actions = apply_filters( 'bp_members_ms_signup_row_actions', $actions, $signup_object ); 344 377 378 // BuddyPress relies on WordPress's `WP_MS_Users_List_Table::row_actions()`. 379 // phpcs:ignore WordPress.Security.EscapeOutput 345 380 echo $this->row_actions( $actions ); 346 381 } … … 409 444 $date = 'Y/m/d'; 410 445 } else { 411 $date = 'Y/m/d \<\b\r \/\> g:i:s a';412 } 413 414 echo mysql2date( $date, $signup_object->registered) . "</td>";446 $date = "Y/m/d \n g:i:s a"; 447 } 448 449 echo nl2br( esc_html( mysql2date( $date, $signup_object->registered ) ) ) . "</td>"; 415 450 } 416 451 … … 430 465 $date = 'Y/m/d'; 431 466 } else { 432 $date = 'Y/m/d \<\b\r \/\> g:i:s a';467 $date = "Y/m/d \n g:i:s a"; 433 468 } 434 469 435 470 if ( $signup_object->count_sent > 0 ) { 436 echo mysql2date( $date, $signup_object->date_sent);471 echo nl2br( esc_html( mysql2date( $date, $signup_object->date_sent ) ) ); 437 472 } else { 438 $message = __( 'Not yet notified', 'buddypress' );473 $message = esc_html__( 'Not yet notified', 'buddypress' ); 439 474 440 475 /** -
trunk/src/bp-members/screens/register.php
r13763 r13799 198 198 */ 199 199 add_action( 'bp_' . $fieldname . '_errors', function() use ( $error_message, $fieldname ) { 200 /** 201 * Filter here to edit the error message about the invalid field value. 202 * 203 * @since 1.5.0 204 * @since 8.0.0 Adds the `$fieldname` parameter. 205 * 206 * @param string $value Error message wrapped in html. 207 * @param string $fieldname The name of the signup field. 208 */ 209 echo apply_filters( 'bp_members_signup_error_message', "<div class=\"error\">" . $error_message . "</div>", $fieldname ); 200 echo wp_kses( 201 /** 202 * Filter here to edit the error message about the invalid field value. 203 * 204 * @since 1.5.0 205 * @since 8.0.0 Adds the `$fieldname` parameter. 206 * 207 * @param string $value Error message wrapped in html. 208 * @param string $fieldname The name of the signup field. 209 */ 210 apply_filters( 'bp_members_signup_error_message', "<div class=\"error\">" . $error_message . "</div>", $fieldname ), 211 array( 212 'div' => array( 'class' => true ), 213 ) 214 ); 210 215 } ); 211 216 }
Note: See TracChangeset
for help on using the changeset viewer.