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/common/template.php

    r6728 r6745  
    20542054        // Pretty permalinks
    20552055        if ( bbp_use_pretty_urls() ) {
     2056
     2057            // Run through home_url()
    20562058            $url = trailingslashit( bbp_get_root_url() . bbp_get_view_slug() ) . $view;
    20572059            $url = user_trailingslashit( $url );
     
    23062308        // Do we want to include a link to home?
    23072309        if ( ! empty( $r['include_home'] ) || empty( $r['home_text'] ) ) {
    2308             $crumbs[] = '<a href="' . trailingslashit( home_url() ) . '" class="bbp-breadcrumb-home">' . $r['home_text'] . '</a>';
     2310            $crumbs[] = '<a href="' . esc_url( home_url() ) . '" class="bbp-breadcrumb-home">' . $r['home_text'] . '</a>';
    23092311        }
    23102312
Note: See TracChangeset for help on using the changeset viewer.