Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/29/2017 12:46:17 AM (8 years ago)
Author:
johnjamesjacoby
Message:

URLs: Audit the usage of trailingslashit().

This change ensures that trailing slashes are only used at the end of URLs where they're expected, and avoids adding slashes at the end of URLs when permalinks are configured not to include them.

See #3181.

File:
1 edited

Legend:

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

    r6700 r6745  
    203203        // Pretty permalinks
    204204        if ( bbp_use_pretty_urls() ) {
     205
     206            // Run through home_url()
    205207            $url = bbp_get_root_url() . bbp_get_search_slug();
    206208            $url = user_trailingslashit( $url );
     
    334336        // Shortcode territory
    335337        if ( is_page() || is_single() ) {
    336             $base = trailingslashit( get_permalink() );
     338            $base = get_permalink();
    337339
    338340        // Default search location
    339341        } else {
    340             $base = trailingslashit( bbp_get_search_results_url() );
     342            $base = bbp_get_search_results_url();
    341343        }
    342344
    343345        // Add pagination base
    344         $base = $base . user_trailingslashit( bbp_get_paged_slug() . '/%#%/' );
     346        $base = trailingslashit( $base ) . user_trailingslashit( bbp_get_paged_slug() . '/%#%/' );
    345347
    346348    // Unpretty permalinks
Note: See TracChangeset for help on using the changeset viewer.