WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#28662 closed defect (bug) (fixed)

$theme_root_uri : double slash

Reported by: tivnet Owned by: wonderboymusic
Milestone: 4.0 Priority: normal
Severity: trivial Version: 2.9
Component: Themes Keywords: has-patch
Focuses: Cc:
PR Number:

Description

When I do (as specified here)
register_theme_directory( ABSPATH . 'wp-content/themes/' );,
all URLs receive extra slash, for instance .../wp/wp-content/themes//twentyfourteen/...
Fixing a couple of lines in theme.php helped (see the patch). I believe, there are more places to patch there - unless there is a better way.

Attachments (2)

theme_root_uri.patch (1.0 KB) - added by tivnet 5 years ago.
28662.diff (358 bytes) - added by obenland 5 years ago.

Download all attachments as: .zip

Change History (7)

#1 @tivnet
5 years ago

  • Keywords has-patch added
  • Severity changed from normal to trivial

#2 @SergeyBiryukov
5 years ago

  • Component changed from General to Themes
  • Milestone changed from Awaiting Review to 4.0

I think untrailingslashit() should be added to register_theme_directory() instead.

#3 @tivnet
5 years ago

If I try with no trailing slash:
register_theme_directory( ABSPATH . 'wp-content/themes' );
the templates never loaded, and I am getting blank screens.

@obenland
5 years ago

#4 @obenland
5 years ago

  • Version changed from 3.9.1 to 2.9

Added in r12025.

Didn't do a whole lot of testing, rather went with SergeyBiryukov's intuition to move this ticket forward.

#5 @wonderboymusic
5 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 29249:

Call untrailingslashit() when adding a theme directory in register_theme_directory(). This prevents double-slashing in generated URLs. Don't add a directory if it is already present.

Adds unit tests.
Props obenland, wonderboymusic.
Fixes #28662.

Note: See TracTickets for help on using tickets.