WordPress.org

Make WordPress Core

Ticket #16562: 16562.2.patch

File 16562.2.patch, 786 bytes (added by hakre, 3 years ago)

Just in case some argu that get_option() might return anything else than an array.

  • wp-admin/includes/plugin.php

     
    563563function deactivate_plugins( $plugins, $silent = false ) { 
    564564        if ( is_multisite() ) 
    565565                $network_current = get_site_option( 'active_sitewide_plugins', array() ); 
    566         $current = get_option( 'active_plugins', array() ); 
     566        $current = (array) get_option( 'active_plugins', array() ); 
    567567        $do_blog = $do_network = false; 
    568568 
    569569        foreach ( (array) $plugins as $plugin ) { 
     
    583583                        $key = array_search( $plugin, $current ); 
    584584                        if ( false !== $key ) { 
    585585                                $do_blog = true; 
    586                                 array_splice( $current, $key, 1 ); 
     586                                unset( $current[ $key ] ); 
    587587                        } 
    588588                } 
    589589