Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/20/2015 04:20:34 PM (11 years ago)
Author:
johnjamesjacoby
Message:

All: ensure all URLs are escaped (trunk) and cleanup some phpdoc

Also introduce bbp_dropdown class for dropdowns.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/topics/template.php

    r5682 r5691  
    21842184     * @uses bbp_get_topic_reply_count() To get the topic reply count
    21852185     * @uses bbp_get_topic_permalink() To get the topic permalink
    2186      * @uses remove_query_arg() To remove args from the url
    21872186     * @uses bbp_get_topic_reply_count_hidden() To get the topic hidden
    21882187     *                                           reply count
    21892188     * @uses current_user_can() To check if the current user can edit others
    21902189     *                           replies
    2191      * @uses add_query_arg() To add custom args to the url
    21922190     * @uses apply_filters() Calls 'bbp_get_topic_replies_link' with the
    21932191     *                        replies link and topic id
     
    21952193    function bbp_get_topic_replies_link( $topic_id = 0 ) {
    21962194
    2197         $topic    = bbp_get_topic( bbp_get_topic_id( (int) $topic_id ) );
     2195        $topic    = bbp_get_topic( $topic_id );
    21982196        $topic_id = $topic->ID;
    21992197        $replies  = sprintf( _n( '%s reply', '%s replies', bbp_get_topic_reply_count( $topic_id, true ), 'bbpress' ), bbp_get_topic_reply_count( $topic_id ) );
     
    25172515            $r['links'] = apply_filters( 'bbp_topic_admin_links', array(
    25182516                'edit'    => bbp_get_topic_edit_link   ( $r ),
     2517                'merge'   => bbp_get_topic_merge_link  ( $r ),
    25192518                'close'   => bbp_get_topic_close_link  ( $r ),
    25202519                'stick'   => bbp_get_topic_stick_link  ( $r ),
    2521                 'merge'   => bbp_get_topic_merge_link  ( $r ),
    25222520                'trash'   => bbp_get_topic_trash_link  ( $r ),
    25232521                'spam'    => bbp_get_topic_spam_link   ( $r ),
     
    25932591
    25942592        // Get the topic
    2595         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     2593        $topic = bbp_get_topic( $r['id'] );
    25962594
    25972595        // Bypass check if user has caps
     
    26442642        global $wp_rewrite;
    26452643
    2646         $topic = bbp_get_topic( bbp_get_topic_id( $topic_id ) );
     2644        $topic = bbp_get_topic( $topic_id );
    26472645        if ( empty( $topic ) ) {
    26482646            return;
     
    27192717        ), 'get_topic_trash_link' );
    27202718
    2721         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     2719        $topic = bbp_get_topic( $r['id'] );
    27222720
    27232721        if ( empty( $topic ) || ! current_user_can( 'delete_topic', $topic->ID ) ) {
     
    27892787        ), 'get_topic_close_link' );
    27902788
    2791         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     2789        $topic = bbp_get_topic( $r['id'] );
    27922790
    27932791        if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) {
     
    28502848        ), 'get_topic_approve_link' );
    28512849
    2852         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     2850        $topic = bbp_get_topic( $r['id'] );
    28532851
    28542852        if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) {
     
    29122910        ), 'get_topic_stick_link' );
    29132911
    2914         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     2912        $topic = bbp_get_topic( $r['id'] );
    29152913
    29162914        if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) {
     
    29822980        ), 'get_topic_merge_link' );
    29832981
    2984         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     2982        $topic = bbp_get_topic( $r['id'] );
    29852983
    29862984        if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) {
     
    30403038        ), 'get_topic_spam_link' );
    30413039
    3042         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     3040        $topic = bbp_get_topic( $r['id'] );
    30433041
    30443042        if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) {
     
    30903088
    30913089        // Get the reply to use it's ID and post_parent
    3092         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     3090        $topic = bbp_get_topic( $r['id'] );
    30933091
    30943092        // Bail if no reply or user cannot reply
     
    32843282        $r = bbp_parse_args( $args, array(
    32853283            'select_id'    => 'bbp_stick_topic',
     3284            'select_class' => 'bbp_dropdown',
    32863285            'tab'          => false,
    32873286            'topic_id'     => 0,
     
    33233322        ob_start(); ?>
    33243323
    3325         <select name="<?php echo esc_attr( $r['select_id'] ); ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select"<?php echo $tab; ?>>
     3324        <select name="<?php echo esc_attr( $r['select_id'] ); ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php echo $tab; ?>>
    33263325
    33273326            <?php foreach ( bbp_get_topic_types() as $key => $label ) : ?>
     
    33723371        // Parse arguments against default values
    33733372        $r = bbp_parse_args( $args, array(
    3374             'select_id' => 'bbp_topic_status',
    3375             'tab'       => false,
    3376             'topic_id'  => 0,
    3377             'selected'  => false
     3373            'select_id'    => 'bbp_topic_status',
     3374            'select_class' => 'bbp_dropdown',
     3375            'tab'          => false,
     3376            'topic_id'     => 0,
     3377            'selected'     => false
    33783378        ), 'topic_open_close_select' );
    33793379
     
    34063406        ob_start(); ?>
    34073407
    3408         <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select"<?php echo $tab; ?>>
     3408        <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php echo $tab; ?>>
    34093409
    34103410            <?php foreach ( bbp_get_topic_statuses( $r['topic_id'] ) as $key => $label ) : ?>
Note: See TracChangeset for help on using the changeset viewer.