Make WordPress Core

Opened 11 years ago

Closed 10 years ago

Last modified 4 years ago

#29122 closed defect (bug) (fixed)

Trailing slash in theme Domain Path header causes double slashes in path

Reported by: bradyvercher's profile bradyvercher Owned by: johnbillion's profile johnbillion
Milestone: 4.1 Priority: normal
Severity: normal Version:
Component: I18N Keywords:
Focuses: Cc:

Description

The Domain Path header in themes is used to load the theme's translation files in WP_Theme::load_textdomain() when it is inactive.

The default value is /languages without a trailing slash and is appended to the theme directory, which is then prepended to the MO file in load_theme_textdomain().

If the Domain Path header has a trailing slash (ex: /languages/), the path ends up with double slashes. I'm not sure it's actually documented anywhere that the header shouldn't have a trailing slash, many of the popular themes in the directory use a trailing slash, and even the Automattic VIP Scanner plugin requires it to have one.

The load_plugin_textdomain() trims trailing slashes in various places to account for this. The attached patch does the same for load_theme_textdomain().

Attachments (1)

29122.patch (485 bytes) - added by bradyvercher 11 years ago.

Download all attachments as: .zip

Change History (5)

@bradyvercher
11 years ago

#1 @voldemortensen
10 years ago

  • Keywords has-patch added

#2 @johnbillion
10 years ago

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

In 29984:

Avoid double path separators in load_theme_textdomain(). Fixes #29122. Props bradyvercher

#3 @johnbillion
10 years ago

  • Keywords has-patch removed
  • Milestone changed from Awaiting Review to 4.1

This ticket was mentioned in Slack in #core-editor by dd32. View the logs.


4 years ago

Note: See TracTickets for help on using tickets.