Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 5 years ago

#29122 closed defect (bug) (fixed)

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

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

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 12 years ago.

Download all attachments as: .zip

Change History (5)

@bradyvercher
12 years ago

#1 @voldemortensen
12 years ago

  • Keywords has-patch added

#2 @johnbillion
12 years ago

  • Owner set to johnbillion
  • Resolutionfixed
  • Status newclosed

In 29984:

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

#3 @johnbillion
12 years ago

  • Keywords has-patch removed
  • Milestone Awaiting Review4.1

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


5 years ago

Note: See TracTickets for help on using tickets.