Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#39168 closed defect (bug) (fixed)

Double slash when loading mu-plugin textdomain

Reported by: nsundberg's profile nsundberg Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.8 Priority: normal
Severity: normal Version: 4.6
Component: I18N Keywords: has-patch
Focuses: Cc:


load_muplugin_textdomain() creates double slashes for load_textdomain(). The function first uses trailingslashit() and then concatenating the path and filename with an additional /.

See lines 756-758 trunk/src/wp-includes/l10n.php#L756:

$path = trailingslashit( WPMU_PLUGIN_DIR . '/' . ltrim( $mu_plugin_rel_path, '/' ) );

return load_textdomain( $domain, $path . '/' . $mofile );

Attachments (1)

l10n.diff (378 bytes) - added by nsundberg 7 years ago.

Download all attachments as: .zip

Change History (5)

7 years ago

#1 @nsundberg
7 years ago

  • Keywords has-patch added

#2 @swissspidy
7 years ago

  • Milestone changed from Awaiting Review to 4.8

#3 @SergeyBiryukov
7 years ago

  • Version changed from trunk to 4.6

Introduced in [37414].

I think we can keep the slash and remove the trailingslashit() call instead, for consistency with load_plugin_textdomain() and load_theme_textdomain().

#4 @SergeyBiryukov
7 years ago

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

In 40362:

I18N: Remove an extra slash between .mo file path and name in load_muplugin_textdomain().

Props nsundberg.
Fixes #39168.

Note: See TracTickets for help on using tickets.