Ticket #8913: 8913.3.patch
| File 8913.3.patch, 8.1 KB (added by , 2 years ago) |
|---|
-
bp-activity-admin.php
17 17 if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); 18 18 19 19 // Per_page screen option. Has to be hooked in extremely early. 20 if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-activity' == $_REQUEST['page'] )20 if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-activity' === $_REQUEST['page'] ) 21 21 add_filter( 'set-screen-option', 'bp_activity_admin_screen_options', 10, 3 ); 22 22 23 23 /** … … 144 144 * @return string|int Option value. False to abandon update. 145 145 */ 146 146 function bp_activity_admin_screen_options( $value, $option, $new_value ) { 147 if ( 'toplevel_page_bp_activity_per_page' != $option && 'toplevel_page_bp_activity_network_per_page' != $option )147 if ( 'toplevel_page_bp_activity_per_page' !== $option && 'toplevel_page_bp_activity_network_per_page' !== $option ) 148 148 return $value; 149 149 150 150 // Per page. … … 213 213 do_action( 'bp_activity_admin_load', $doaction ); 214 214 215 215 // Edit screen. 216 if ( 'edit' == $doaction && ! empty( $_GET['aid'] ) ) {216 if ( 'edit' === $doaction && ! empty( $_GET['aid'] ) ) { 217 217 // Columns screen option. 218 218 add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) ); 219 219 … … 775 775 <div id="post-body-content"> 776 776 <div id="postdiv"> 777 777 <div id="bp_activity_action" class="activitybox"> 778 <h2><?php _e( 'Action', 'buddypress' ); ?></h2>778 <h2><?php esc_html_e( 'Action', 'buddypress' ); ?></h2> 779 779 <div class="inside"> 780 780 <label for="bp-activities-action" class="screen-reader-text"><?php 781 781 /* translators: accessibility text */ 782 _e( 'Edit activity action', 'buddypress' );782 esc_html_e( 'Edit activity action', 'buddypress' ); 783 783 ?></label> 784 784 <?php wp_editor( stripslashes( $activity->action ), 'bp-activities-action', array( 'media_buttons' => false, 'textarea_rows' => 7, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?> 785 785 </div> … … 786 786 </div> 787 787 788 788 <div id="bp_activity_content" class="activitybox"> 789 <h2><?php _e( 'Content', 'buddypress' ); ?></h2>789 <h2><?php esc_html_e( 'Content', 'buddypress' ); ?></h2> 790 790 <div class="inside"> 791 791 <label for="bp-activities-content" class="screen-reader-text"><?php 792 792 /* translators: accessibility text */ 793 _e( 'Edit activity content', 'buddypress' );793 esc_html_e( 'Edit activity content', 'buddypress' ); 794 794 ?></label> 795 795 <?php wp_editor( stripslashes( $activity->content ), 'bp-activities-content', array( 'media_buttons' => false, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?> 796 796 </div> … … 913 913 914 914 <label class="screen-reader-text" for="bp-activities-link"><?php 915 915 /* translators: accessibility text */ 916 _e( 'Link', 'buddypress' );916 esc_html_e( 'Link', 'buddypress' ); 917 917 ?></label> 918 918 <input type="url" name="bp-activities-link" id="bp-activities-link" value="<?php echo esc_url( $item->primary_link ); ?>" aria-describedby="bp-activities-link-description" /> 919 <p id="bp-activities-link-description"><?php _e( 'Activity generated by posts and comments uses the link field for a permalink back to the content item.', 'buddypress' ); ?></p>919 <p id="bp-activities-link-description"><?php esc_html_e( 'Activity generated by posts and comments uses the link field for a permalink back to the content item.', 'buddypress' ); ?></p> 920 920 921 921 <?php 922 922 } … … 933 933 934 934 <label class="screen-reader-text" for="bp-activities-userid"><?php 935 935 /* translators: accessibility text */ 936 _e( 'Author ID', 'buddypress' );936 esc_html_e( 'Author ID', 'buddypress' ); 937 937 ?></label> 938 938 <input type="number" name="bp-activities-userid" id="bp-activities-userid" value="<?php echo esc_attr( $item->user_id ); ?>" min="1" /> 939 939 … … 1053 1053 function bp_activity_admin_edit_metabox_itemids( $item ) { 1054 1054 ?> 1055 1055 1056 <label for="bp-activities-primaryid"><?php _e( 'Primary Item ID', 'buddypress' ); ?></label>1056 <label for="bp-activities-primaryid"><?php esc_html_e( 'Primary Item ID', 'buddypress' ); ?></label> 1057 1057 <input type="number" name="bp-activities-primaryid" id="bp-activities-primaryid" value="<?php echo esc_attr( $item->item_id ); ?>" min="0" /> 1058 1058 <br /> 1059 1059 1060 <label for="bp-activities-secondaryid"><?php _e( 'Secondary Item ID', 'buddypress' ); ?></label>1060 <label for="bp-activities-secondaryid"><?php esc_html_e( 'Secondary Item ID', 'buddypress' ); ?></label> 1061 1061 <input type="number" name="bp-activities-secondaryid" id="bp-activities-secondaryid" value="<?php echo esc_attr( $item->secondary_item_id ); ?>" min="0" /> 1062 1062 1063 <p><?php _e( 'These identify the object that created this activity. For example, the fields could reference a pair of site and comment IDs.', 'buddypress' ); ?></p>1063 <p><?php esc_html_e( 'These identify the object that created this activity. For example, the fields could reference a pair of site and comment IDs.', 'buddypress' ); ?></p> 1064 1064 1065 1065 <?php 1066 1066 } -
classes/class-bp-activity-list-table.php
111 111 112 112 // Filter. 113 113 if ( ! empty( $_REQUEST['activity_type'] ) ) { 114 $filter = array( 'action' => $_REQUEST['activity_type']);114 $filter = array( 'action' => sanitize_text_field( $_REQUEST['activity_type'] ) ); 115 115 116 116 // Set the view as a filtered one. 117 117 $this->view = 'filtered'; … … 260 260 * @since 1.6.0 261 261 */ 262 262 function no_items() { 263 _e( 'No activities found.', 'buddypress' );263 esc_attr_e( 'No activities found.', 'buddypress' ); 264 264 } 265 265 266 266 /** … … 273 273 274 274 <h2 class="screen-reader-text"><?php 275 275 /* translators: accessibility text */ 276 _e( 'Activities list', 'buddypress' );276 esc_attr_e( 'Activities list', 'buddypress' ); 277 277 ?></h2> 278 278 279 279 <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0"> … … 465 465 } 466 466 467 467 // Is any filter currently selected? 468 $selected = ( ! empty( $_REQUEST['activity_type'] ) ) ? $_REQUEST['activity_type']: '';468 $selected = ( ! empty( $_REQUEST['activity_type'] ) ) ? sanitize_text_field( $_REQUEST['activity_type'] ) : ''; 469 469 470 470 // Get the actions. 471 471 $activity_actions = bp_activity_get_actions(); ?> … … 473 473 <div class="alignleft actions"> 474 474 <label for="activity-type" class="screen-reader-text"><?php 475 475 /* translators: accessibility text */ 476 _e( 'Filter by activity type', 'buddypress' );476 esc_html_e( 'Filter by activity type', 'buddypress' ); 477 477 ?></label> 478 478 <select name="activity_type" id="activity-type"> 479 <option value="" <?php selected( ! $selected ); ?>><?php _e( 'View all actions', 'buddypress' ); ?></option>479 <option value="" <?php selected( ! $selected ); ?>><?php esc_html_e( 'View all actions', 'buddypress' ); ?></option> 480 480 481 481 <?php foreach ( $activity_actions as $component => $actions ) : ?> 482 482 <?php … … 503 503 } 504 504 ?> 505 505 506 <optgroup label="<?php echo esc_ html( $component_name ); ?>">506 <optgroup label="<?php echo esc_attr( $component_name ); ?>"> 507 507 508 508 <?php foreach ( $actions as $action_key => $action_values ) : ?> 509 509 … … 645 645 646 646 // Rollover actions. 647 647 // Reply - JavaScript only; implemented by AJAX. 648 if ( 'spam' != $item_status ) {648 if ( 'spam' !== $item_status ) { 649 649 if ( $this->can_comment( $item ) ) { 650 650 $actions['reply'] = sprintf( '<a href="#" class="reply hide-if-no-js">%s</a>', esc_html__( 'Reply', 'buddypress' ) ); 651 651 } else { … … 657 657 } 658 658 659 659 // Spam/unspam. 660 if ( 'spam' == $item_status ) {660 if ( 'spam' === $item_status ) { 661 661 $actions['unspam'] = sprintf( '<a href="%s">%s</a>', esc_url( $ham_url ), esc_html__( 'Not Spam', 'buddypress' ) ); 662 662 } else { 663 663 $actions['spam'] = sprintf( '<a href="%s">%s</a>', esc_url( $spam_url ), esc_html__( 'Spam', 'buddypress' ) );