Skip to:
Content

BuddyPress.org

Ticket #8913: 8913.3.patch

File 8913.3.patch, 8.1 KB (added by viralsampat, 2 years ago)

I have checked above mentioned issue and founds few more files. I have applied its patch.

  • bp-activity-admin.php

     
    1717if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
    1818
    1919// Per_page screen option. Has to be hooked in extremely early.
    20 if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-activity' == $_REQUEST['page'] )
     20if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-activity' === $_REQUEST['page'] )
    2121        add_filter( 'set-screen-option', 'bp_activity_admin_screen_options', 10, 3 );
    2222
    2323/**
     
    144144 * @return string|int Option value. False to abandon update.
    145145 */
    146146function 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 )
    148148                return $value;
    149149
    150150        // Per page.
     
    213213        do_action( 'bp_activity_admin_load', $doaction );
    214214
    215215        // Edit screen.
    216         if ( 'edit' == $doaction && ! empty( $_GET['aid'] ) ) {
     216        if ( 'edit' === $doaction && ! empty( $_GET['aid'] ) ) {
    217217                // Columns screen option.
    218218                add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) );
    219219
     
    775775                                                <div id="post-body-content">
    776776                                                        <div id="postdiv">
    777777                                                                <div id="bp_activity_action" class="activitybox">
    778                                                                         <h2><?php _e( 'Action', 'buddypress' ); ?></h2>
     778                                                                        <h2><?php esc_html_e( 'Action', 'buddypress' ); ?></h2>
    779779                                                                        <div class="inside">
    780780                                                                                <label for="bp-activities-action" class="screen-reader-text"><?php
    781781                                                                                        /* translators: accessibility text */
    782                                                                                         _e( 'Edit activity action', 'buddypress' );
     782                                                                                        esc_html_e( 'Edit activity action', 'buddypress' );
    783783                                                                                ?></label>
    784784                                                                                <?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' ) ) ); ?>
    785785                                                                        </div>
     
    786786                                                                </div>
    787787
    788788                                                                <div id="bp_activity_content" class="activitybox">
    789                                                                         <h2><?php _e( 'Content', 'buddypress' ); ?></h2>
     789                                                                        <h2><?php esc_html_e( 'Content', 'buddypress' ); ?></h2>
    790790                                                                        <div class="inside">
    791791                                                                                <label for="bp-activities-content" class="screen-reader-text"><?php
    792792                                                                                        /* translators: accessibility text */
    793                                                                                         _e( 'Edit activity content', 'buddypress' );
     793                                                                                        esc_html_e( 'Edit activity content', 'buddypress' );
    794794                                                                                ?></label>
    795795                                                                                <?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' ) ) ); ?>
    796796                                                                        </div>
     
    913913
    914914        <label class="screen-reader-text" for="bp-activities-link"><?php
    915915                /* translators: accessibility text */
    916                 _e( 'Link', 'buddypress' );
     916                esc_html_e( 'Link', 'buddypress' );
    917917        ?></label>
    918918        <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>
    920920
    921921<?php
    922922}
     
    933933
    934934        <label class="screen-reader-text" for="bp-activities-userid"><?php
    935935                /* translators: accessibility text */
    936                 _e( 'Author ID', 'buddypress' );
     936                esc_html_e( 'Author ID', 'buddypress' );
    937937        ?></label>
    938938        <input type="number" name="bp-activities-userid" id="bp-activities-userid" value="<?php echo esc_attr( $item->user_id ); ?>" min="1" />
    939939
     
    10531053function bp_activity_admin_edit_metabox_itemids( $item ) {
    10541054?>
    10551055
    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>
    10571057        <input type="number" name="bp-activities-primaryid" id="bp-activities-primaryid" value="<?php echo esc_attr( $item->item_id ); ?>" min="0" />
    10581058        <br />
    10591059
    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>
    10611061        <input type="number" name="bp-activities-secondaryid" id="bp-activities-secondaryid" value="<?php echo esc_attr( $item->secondary_item_id ); ?>" min="0" />
    10621062
    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>
    10641064
    10651065<?php
    10661066}
  • classes/class-bp-activity-list-table.php

     
    111111
    112112                // Filter.
    113113                if ( ! empty( $_REQUEST['activity_type'] ) ) {
    114                         $filter = array( 'action' => $_REQUEST['activity_type'] );
     114                        $filter = array( 'action' => sanitize_text_field( $_REQUEST['activity_type'] ) );
    115115
    116116                        // Set the view as a filtered one.
    117117                        $this->view = 'filtered';
     
    260260         * @since 1.6.0
    261261         */
    262262        function no_items() {
    263                 _e( 'No activities found.', 'buddypress' );
     263                esc_attr_e( 'No activities found.', 'buddypress' );
    264264        }
    265265
    266266        /**
     
    273273
    274274                <h2 class="screen-reader-text"><?php
    275275                        /* translators: accessibility text */
    276                         _e( 'Activities list', 'buddypress' );
     276                        esc_attr_e( 'Activities list', 'buddypress' );
    277277                ?></h2>
    278278
    279279                <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
     
    465465                }
    466466
    467467                // 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'] ) : '';
    469469
    470470                // Get the actions.
    471471                $activity_actions = bp_activity_get_actions(); ?>
     
    473473                <div class="alignleft actions">
    474474                        <label for="activity-type" class="screen-reader-text"><?php
    475475                                /* translators: accessibility text */
    476                                 _e( 'Filter by activity type', 'buddypress' );
     476                                esc_html_e( 'Filter by activity type', 'buddypress' );
    477477                        ?></label>
    478478                        <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>
    480480
    481481                                <?php foreach ( $activity_actions as $component => $actions ) : ?>
    482482                                        <?php
     
    503503                                        }
    504504                                        ?>
    505505
    506                                         <optgroup label="<?php echo esc_html( $component_name ); ?>">
     506                                        <optgroup label="<?php echo esc_attr( $component_name ); ?>">
    507507
    508508                                                <?php foreach ( $actions as $action_key => $action_values ) : ?>
    509509
     
    645645
    646646                // Rollover actions.
    647647                // Reply - JavaScript only; implemented by AJAX.
    648                 if ( 'spam' != $item_status ) {
     648                if ( 'spam' !== $item_status ) {
    649649                        if ( $this->can_comment( $item ) ) {
    650650                                $actions['reply'] = sprintf( '<a href="#" class="reply hide-if-no-js">%s</a>', esc_html__( 'Reply', 'buddypress' ) );
    651651                        } else {
     
    657657                }
    658658
    659659                // Spam/unspam.
    660                 if ( 'spam' == $item_status ) {
     660                if ( 'spam' === $item_status ) {
    661661                        $actions['unspam'] = sprintf( '<a href="%s">%s</a>', esc_url( $ham_url ), esc_html__( 'Not Spam', 'buddypress' ) );
    662662                } else {
    663663                        $actions['spam'] = sprintf( '<a href="%s">%s</a>', esc_url( $spam_url ), esc_html__( 'Spam', 'buddypress' ) );