From 46daa240b9d187d45aa47011e7ff5491fc220022 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Thu, 22 Aug 2013 04:03:09 +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 Built from https://develop.svn.wordpress.org/trunk@25081 git-svn-id: http://core.svn.wordpress.org/trunk@25066 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/plugin.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index 109e66d8b7..70be7cafed 100644 --- a/wp-admin/includes/plugin.php +++ b/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'] ) {