From f9d97b8cb1607a15f2d00f3f0d5a0a89cb468ac8 Mon Sep 17 00:00:00 2001 From: GaryJones Date: Fri, 30 Aug 2013 11:00:33 +0100 Subject: [PATCH] Make WP_LANG_DIR constant safer We assume that someone defining WP_LANG_DIR will do so without a trailing slash, since we then add our own before adding in the rest of the path to the .mo file. This change gets removes that assumption by removing our own slash from the string, and wrapping WP_LANG_DIR in trailingslashit() instead. --- plugin-name/class-plugin-name.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin-name/class-plugin-name.php b/plugin-name/class-plugin-name.php index ef684b7..fd7510f 100644 --- a/plugin-name/class-plugin-name.php +++ b/plugin-name/class-plugin-name.php @@ -139,7 +139,7 @@ class Plugin_Name { $domain = $this->plugin_slug; $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); - load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' ); + load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '/' . $domain . '-' . $locale . '.mo' ); load_plugin_textdomain( $domain, FALSE, basename( dirname( __FILE__ ) ) . '/lang/' ); }