Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#39168 closed defect (bug) (fixed)

Double slash when loading mu-plugin textdomain

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

Description

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

Download all attachments as: .zip

Change History (5)

@nsundberg
10 years ago

#1 @nsundberg
10 years ago

  • Keywords has-patch added

#2 @swissspidy
10 years ago

  • Milestone Awaiting Review → 4.8

#3 @SergeyBiryukov
10 years ago

  • Version trunk → 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
10 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → 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.