Add AuthorName to get_plugins() and use it when deleting a plugin. fixes #15662.

git-svn-id: https://develop.svn.wordpress.org/trunk@16757 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-12-06 20:49:54 +00:00
parent 975fb7af21
commit efbe42fc1c
2 changed files with 17 additions and 9 deletions

View File

@ -117,6 +117,17 @@ function _get_plugin_data_markup_translate($plugin_file, $plugin_data, $markup =
$plugin_data[ $field ] = translate($plugin_data[ $field ], $plugin_data['TextDomain']); $plugin_data[ $field ] = translate($plugin_data[ $field ], $plugin_data['TextDomain']);
} }
$plugins_allowedtags = array(
'a' => array( 'href' => array(), 'title' => array() ),
'abbr' => array( 'title' => array() ),
'acronym' => array( 'title' => array() ),
'code' => array(),
'em' => array(),
'strong' => array(),
);
$plugin_data['AuthorName'] = $plugin_data['Author'] = wp_kses( $plugin_data['Author'], $plugins_allowedtags );
//Apply Markup //Apply Markup
if ( $markup ) { if ( $markup ) {
if ( ! empty($plugin_data['PluginURI']) && ! empty($plugin_data['Name']) ) if ( ! empty($plugin_data['PluginURI']) && ! empty($plugin_data['Name']) )
@ -132,13 +143,10 @@ function _get_plugin_data_markup_translate($plugin_file, $plugin_data, $markup =
$plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>'; $plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>';
} }
$plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array()); // Sanitize all displayed data. Author and AuthorName sanitized above.
$plugin_data['Title'] = wp_kses( $plugin_data['Title'], $plugins_allowedtags );
// Sanitize all displayed data $plugin_data['Version'] = wp_kses( $plugin_data['Version'], $plugins_allowedtags );
$plugin_data['Title'] = wp_kses($plugin_data['Title'], $plugins_allowedtags); $plugin_data['Description'] = wp_kses( $plugin_data['Description'], $plugins_allowedtags );
$plugin_data['Version'] = wp_kses($plugin_data['Version'], $plugins_allowedtags);
$plugin_data['Description'] = wp_kses($plugin_data['Description'], $plugins_allowedtags);
$plugin_data['Author'] = wp_kses($plugin_data['Author'], $plugins_allowedtags);
return $plugin_data; return $plugin_data;
} }

View File

@ -236,11 +236,11 @@ if ( $action ) {
foreach ( $plugin_info as $plugin ) { foreach ( $plugin_info as $plugin ) {
if ( $plugin['is_uninstallable'] ) { if ( $plugin['is_uninstallable'] ) {
/* translators: 1: plugin name, 2: plugin author */ /* translators: 1: plugin name, 2: plugin author */
echo '<li>', sprintf( __( '<strong>%1$s</strong> by <em>%2$s</em> (will also <strong>delete its data</strong>)' ), esc_html($plugin['Name']), esc_html($plugin['Author']) ), '</li>'; echo '<li>', sprintf( __( '<strong>%1$s</strong> by <em>%2$s</em> (will also <strong>delete its data</strong>)' ), esc_html($plugin['Name']), esc_html($plugin['AuthorName']) ), '</li>';
$data_to_delete = true; $data_to_delete = true;
} else { } else {
/* translators: 1: plugin name, 2: plugin author */ /* translators: 1: plugin name, 2: plugin author */
echo '<li>', sprintf( __('<strong>%1$s</strong> by <em>%2$s</em>' ), esc_html($plugin['Name']), esc_html($plugin['Author']) ), '</li>'; echo '<li>', sprintf( __('<strong>%1$s</strong> by <em>%2$s</em>' ), esc_html($plugin['Name']), esc_html($plugin['AuthorName']) ), '</li>';
} }
} }
?> ?>