From ddad24c82c4407eefdcb3e0e39c4f80e827d5f96 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Thu, 22 Aug 2013 04:02:13 +0000 Subject: [PATCH] Sanitize the plugin path in `_get_plugin_data_markup_translate()` to a WP_PLUGIN_DIR-relative path. The function is designed in mind for receiving relative paths, but may be used with a absolute path. This change makes the function path-agnostic, and can accept either relative or absolute (converting to relative internally). Fixes #20813 git-svn-id: https://develop.svn.wordpress.org/trunk@25081 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/plugin.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wp-admin/includes/plugin.php b/src/wp-admin/includes/plugin.php index 109e66d8b7..70be7cafed 100644 --- a/src/wp-admin/includes/plugin.php +++ b/src/wp-admin/includes/plugin.php @@ -114,6 +114,9 @@ function get_plugin_data( $plugin_file, $markup = true, $translate = true ) { */ function _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup = true, $translate = true ) { + // Sanitize the plugin filename to a WP_PLUGIN_DIR relative path + $plugin_file = plugin_basename( $plugin_file ); + // Translate fields if ( $translate ) { if ( $textdomain = $plugin_data['TextDomain'] ) {