Make WordPress Core


Ignore:
Timestamp:
02/04/2008 08:38:48 PM (17 years ago)
Author:
ryan
Message:

Dashboard fixes from mdawaffe. No longer stomps sidebar. see #5750

File:
1 edited

Legend:

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

    r6679 r6717  
    2222        $already_shown = array();
    2323        foreach ( $wp_registered_widgets as $name => $widget ) :
    24             if ( in_array( $widget['callback'], $already_shown ) )
     24            if ( in_array( $widget['callback'], $already_shown ) ) // We already showed this multi-widget
    2525                continue;
    26             $already_shown[] = $widget['callback'];
    2726
    2827            if ( $search_terms ) {
     
    5352
    5453            if ( !$sidebar || false !== strpos( $widget_control_template, '%i%' ) ) {
     54                $already_shown[] = $widget['callback']; // it's a multi-widget.  We only need to show it in the list once.
    5555                $action = 'add';
    5656                $add_url = wp_nonce_url( add_query_arg( array(
     
    6767                    'key' => array_search( $widget['id'], $sidebars_widgets[$sidebar] ),
    6868                ) );
    69                 $widget_control_template = "<textarea>$widget_control_template</textarea>";
     69                $widget_control_template = '<textarea>' . htmlspecialchars( $widget_control_template ) . '</textarea>';
    7070            }
    7171
Note: See TracChangeset for help on using the changeset viewer.