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
This commit is contained in:
Dion Hulse 2013-08-22 04:02:13 +00:00
parent 8af525762c
commit ddad24c82c
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 ) {
// 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'] ) {