Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/18/2013 07:16:23 AM (13 years ago)
Author:
johnjamesjacoby
Message:

More esc_url() improvements, and practice late-escaping where we were otherwise passing around escaped URL variables. See #2367.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/topics/template-tags.php

    r5037 r5040  
    25432543        $display = bbp_is_topic_open( $topic->ID ) ? $r['close_text'] : $r['open_text'];
    25442544        $uri     = add_query_arg( array( 'action' => 'bbp_toggle_topic_close', 'topic_id' => $topic->ID ) );
    2545         $uri     = esc_url( wp_nonce_url( $uri, 'close-topic_' . $topic->ID ) );
    2546         $retval  = $r['link_before'] . '<a href="' . $uri . '">' . $display . '</a>' . $r['link_after'];
     2545        $uri     = wp_nonce_url( $uri, 'close-topic_' . $topic->ID );
     2546        $retval  = $r['link_before'] . '<a href="' . esc_url( $uri ) . '">' . $display . '</a>' . $r['link_after'];
    25472547
    25482548        return apply_filters( 'bbp_get_topic_close_link', $retval, $r );
     
    26052605
    26062606        $stick_uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_stick', 'topic_id' => $topic->ID ) );
    2607         $stick_uri = esc_url( wp_nonce_url( $stick_uri, 'stick-topic_' . $topic->ID ) );
     2607        $stick_uri = wp_nonce_url( $stick_uri, 'stick-topic_' . $topic->ID );
    26082608
    26092609        $stick_display = true === $is_sticky ? $r['unstick_text'] : $r['stick_text'];
    2610         $stick_display = '<a href="' . $stick_uri . '">' . $stick_display . '</a>';
     2610        $stick_display = '<a href="' . esc_url( $stick_uri ) . '">' . $stick_display . '</a>';
    26112611
    26122612        if ( empty( $is_sticky ) ) {
    26132613            $super_uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_stick', 'topic_id' => $topic->ID, 'super' => 1 ) );
    2614             $super_uri = esc_url( wp_nonce_url( $super_uri, 'stick-topic_' . $topic->ID ) );
    2615 
    2616             $super_display = ' (<a href="' . $super_uri . '">' . $r['super_text'] . '</a>)';
     2614            $super_uri = wp_nonce_url( $super_uri, 'stick-topic_' . $topic->ID );
     2615
     2616            $super_display = ' (<a href="' . esc_url( $super_uri ) . '">' . $r['super_text'] . '</a>)';
    26172617        } else {
    26182618            $super_display = '';
     
    26712671            return;
    26722672
    2673         $uri    = esc_url( add_query_arg( array( 'action' => 'merge' ), bbp_get_topic_edit_url( $topic->ID ) ) );
    2674         $retval = $r['link_before'] . '<a href="' . $uri . '">' . $r['merge_text'] . '</a>' . $r['link_after'];
     2673        $uri    = add_query_arg( array( 'action' => 'merge' ), bbp_get_topic_edit_url( $topic->ID ) );
     2674        $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '">' . $r['merge_text'] . '</a>' . $r['link_after'];
    26752675
    26762676        return apply_filters( 'bbp_get_topic_merge_link', $retval, $args );
     
    27302730        $display = bbp_is_topic_spam( $topic->ID ) ? $r['unspam_text'] : $r['spam_text'];
    27312731        $uri     = add_query_arg( array( 'action' => 'bbp_toggle_topic_spam', 'topic_id' => $topic->ID ) );
    2732         $uri     = esc_url( wp_nonce_url( $uri, 'spam-topic_' . $topic->ID ) );
    2733         $retval  = $r['link_before'] . '<a href="' . $uri . '">' . $display . '</a>' . $r['link_after'];
     2732        $uri     = wp_nonce_url( $uri, 'spam-topic_' . $topic->ID );
     2733        $retval  = $r['link_before'] . '<a href="' . esc_url( $uri ) . '">' . $display . '</a>' . $r['link_after'];
    27342734
    27352735        return apply_filters( 'bbp_get_topic_spam_link', $retval, $r );
Note: See TracChangeset for help on using the changeset viewer.