#29122 closed defect (bug) (fixed)
Trailing slash in theme Domain Path header causes double slashes in path
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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().
In 29984: