WordPress.org

Make WordPress Core

Ticket #9018: 9018.diff

File 9018.diff, 691 bytes (added by ionfish, 9 years ago)
  • wp-admin/widgets.php

     
    8989        ob_end_clean();
    9090
    9191        // Prophylactic.  Take out empty ids.
    92         foreach ( (array) $_POST['widget-id'] as $key => $val )
    93                 if ( !$val )
    94                         unset($_POST['widget-id'][$key]);
     92        if ( isset($_POST['widget-id']) )
     93                foreach ( (array) $_POST['widget-id'] as $key => $val )
     94                        if ( !$val )
     95                                unset($_POST['widget-id'][$key]);
    9596
    9697        // Reset the key numbering and store
    9798        $new_sidebar = isset( $_POST['widget-id'] ) && is_array( $_POST['widget-id'] ) ? array_values( $_POST['widget-id'] ) : array();