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
This commit is contained in:
Dion Hulse 2013-08-22 04:03:09 +00:00
parent 6509e4e686
commit 46daa240b9
1 changed files with 3 additions and 0 deletions

View File

@ -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 ) { 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 // Translate fields
if ( $translate ) { if ( $translate ) {
if ( $textdomain = $plugin_data['TextDomain'] ) { if ( $textdomain = $plugin_data['TextDomain'] ) {