WordPress.org

Make WordPress Core

Ticket #5607: remove_admin_notices6.diff

File remove_admin_notices6.diff, 2.4 KB (added by filosofo, 7 years ago)
  • wp-admin/includes/plugin.php

     
    1818        $name = $plugin_name[1]; 
    1919        $name = trim( $name ); 
    2020        $plugin = $name; 
    21         if ('' != trim($plugin_uri[1]) && '' != $name ) { 
     21        if (isset($plugin_uri[1]) && '' != trim($plugin_uri[1]) && '' != $name ) { 
    2222                $plugin = '<a href="' . trim( $plugin_uri[1] ) . '" title="'.__( 'Visit plugin homepage' ).'">'.$plugin.'</a>'; 
    2323        } 
    2424 
    25         if ('' == $author_uri[1] ) { 
     25        if (! isset($author_uri[1]) || '' == $author_uri[1] ) { 
    2626                $author = trim( $author_name[1] ); 
    2727        } else { 
    2828                $author = '<a href="' . trim( $author_uri[1] ) . '" title="'.__( 'Visit author homepage' ).'">' . trim( $author_name[1] ) . '</a>'; 
  • wp-admin/includes/theme.php

     
    3838                        preg_match( '|Template Name:(.*)$|mi', $template_data, $name ); 
    3939                        preg_match( '|Description:(.*)$|mi', $template_data, $description ); 
    4040 
    41                         $name = $name[1]; 
    42                         $description = $description[1]; 
     41                        $name = ( isset($name[1]) ) ? $name[1] : null; 
     42                        $description = ( isset($description[1]) ) ? $description[1] : null; 
    4343 
    4444                        if ( !empty( $name ) ) { 
    4545                                $page_templates[trim( $name )] = basename( $template ); 
  • wp-admin/includes/widgets.php

     
    146146function wp_widget_control( $key, $widget, $display = 'display' ) { 
    147147        static $i = 0; 
    148148        global $wp_registered_widgets, $wp_registered_widget_controls; 
    149         $control = $wp_registered_widget_controls[$widget]; 
    150         $widget  = $wp_registered_widgets[$widget]; 
     149        $control = (isset($wp_registered_widget_controls[$widget])) ? $wp_registered_widget_controls[$widget] : null; 
     150        $widget  = (isset($wp_registered_widgets[$widget])) ? $wp_registered_widgets[$widget] : null; 
    151151 
    152         $id_format = $widget['id']; 
     152        $id_format = ( isset($widget['id']) ) ? $widget['id'] : null; 
    153153        if ( 'template' == $display && isset($control['params'][0]['number']) ) { 
    154154                // number == -1 implies a template where id numbers are replaced by a generic '%i%' 
    155155                $control['params'][0]['number'] = -1;