Make WordPress Core

Changeset 16757


Ignore:
Timestamp:
12/06/2010 08:49:54 PM (14 years ago)
Author:
nacin
Message:

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

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/plugin.php

    r16660 r16757  
    118118    }
    119119
     120    $plugins_allowedtags = array(
     121        'a'       => array( 'href' => array(), 'title' => array() ),
     122        'abbr'    => array( 'title' => array() ),
     123        'acronym' => array( 'title' => array() ),
     124        'code'    => array(),
     125        'em'      => array(),
     126        'strong'  => array(),
     127    );
     128
     129    $plugin_data['AuthorName'] = $plugin_data['Author'] = wp_kses( $plugin_data['Author'], $plugins_allowedtags );
     130
    120131    //Apply Markup
    121132    if ( $markup ) {
     
    133144    }
    134145
    135     $plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array());
    136 
    137     // Sanitize all displayed data
    138     $plugin_data['Title']       = wp_kses($plugin_data['Title'], $plugins_allowedtags);
    139     $plugin_data['Version']     = wp_kses($plugin_data['Version'], $plugins_allowedtags);
    140     $plugin_data['Description'] = wp_kses($plugin_data['Description'], $plugins_allowedtags);
    141     $plugin_data['Author']      = wp_kses($plugin_data['Author'], $plugins_allowedtags);
     146    // Sanitize all displayed data. Author and AuthorName sanitized above.
     147    $plugin_data['Title']       = wp_kses( $plugin_data['Title'],       $plugins_allowedtags );
     148    $plugin_data['Version']     = wp_kses( $plugin_data['Version'],     $plugins_allowedtags );
     149    $plugin_data['Description'] = wp_kses( $plugin_data['Description'], $plugins_allowedtags );
    142150
    143151    return $plugin_data;
  • trunk/wp-admin/plugins.php

    r16696 r16757  
    237237                            if ( $plugin['is_uninstallable'] ) {
    238238                                /* translators: 1: plugin name, 2: plugin author */
    239                                 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>';
     239                                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>';
    240240                                $data_to_delete = true;
    241241                            } else {
    242242                                /* translators: 1: plugin name, 2: plugin author */
    243                                 echo '<li>', sprintf( __('<strong>%1$s</strong> by <em>%2$s</em>' ), esc_html($plugin['Name']), esc_html($plugin['Author']) ), '</li>';
     243                                echo '<li>', sprintf( __('<strong>%1$s</strong> by <em>%2$s</em>' ), esc_html($plugin['Name']), esc_html($plugin['AuthorName']) ), '</li>';
    244244                            }
    245245                        }
Note: See TracChangeset for help on using the changeset viewer.