Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/06/2013 11:48:53 PM (12 years ago)
Author:
boonebgorges
Message:

When building get_views() links on Groups and Activity admin, build URL base from scratch

Previously, we were taking the current URL and removing query args by name.
Invariably, some query args would be forgotten about, leading to unpredictable
results. By building the base URL from scratch, we avoid any danglers.

Fixes #4901

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-admin.php

    r7166 r7175  
    11281128     */
    11291129    function get_views() {
    1130         $redirect_to = remove_query_arg( array( 'activity_status', 'aid', 'deleted', 'error', 'spammed', 'unspammed', 'updated', ), $_SERVER['REQUEST_URI'] );
    1131     ?>
     1130        $url_base = bp_get_admin_url( 'admin.php?page=bp-activity' ); ?>
     1131
    11321132        <ul class="subsubsub">
    1133             <li class="all"><a href="<?php echo esc_attr( esc_url( $redirect_to ) ); ?>" class="<?php if ( 'spam' != $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>
    1134             <li class="spam"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'activity_status', 'spam', $redirect_to ) ) ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->spam_count ) ); ?></a></li>
    1135 
    1136             <?php do_action( 'bp_activity_list_table_get_views', $redirect_to, $this->view ); ?>
     1133            <li class="all"><a href="<?php echo esc_attr( esc_url( $url_base ) ); ?>" class="<?php if ( 'spam' != $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>
     1134            <li class="spam"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'activity_status', 'spam', $url_base ) ) ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->spam_count ) ); ?></a></li>
     1135
     1136            <?php do_action( 'bp_activity_list_table_get_views', $url_base, $this->view ); ?>
    11371137        </ul>
    11381138    <?php
Note: See TracChangeset for help on using the changeset viewer.