Log in with username/password: lyceum/lyceum

Ticket #682 (new defect)

Opened 2 years ago

Last modified 1 year ago

System Wide Plugins not being loaded under certain conditions

Reported by: lyceum Assigned to:
Priority: normal Milestone: 1.1
Keywords: Cc:

Description (Last modified by jjb)

Under certain conditions (no "local" plugins being loaded - whatever that might mean if you're loggin in as admin), global plugins don't work. This is fatal when (eg.) a global plugin is supposed to change the Authentication Method, which is the case for me.

This is due to a bug in (some) PHP (versions), which think(s) array_merge(NULL,x) == NULL, not == x.

Solution:

  • src/lib/wp-settings.php

    old new  
    196196               require(ABSPATH . '/my-hacks.php'); 
    197197} 
    198198 
    199 if ( get_settings('active_plugins') || get_settings('active_system_plugins')) { 
    200        $current_plugins = array_merge(get_settings('active_plugins'), get_settings('active_system_plugins')); 
     199$plugins1=get_settings('active_plugins'); 
     200if (!$plugins1) 
     201     $plugins1=array(); 
     202 
     203$plugins2=get_settings('active_system_plugins'); 
     204if (!$plugins2) 
     205     $plugins2=array(); 
     206 
     207if ( $plugins1 || $plugins2) { 
     208  $current_plugins = array_merge($plugins1, $plugins2); 
    201209       if ( is_array($current_plugins) ) { 
    202210               foreach ($current_plugins as $plugin) { 
    203211                       if ('' != $plugin && file_exists(ABSPATH 

Change History

11/08/06 06:44:57 changed by lyceum

Wiki-Formatting broke the patch. The source ought to be correct though.

11/11/06 01:47:06 changed by jjb

  • priority changed from normal to high.
  • milestone set to 0.40.

10/20/07 23:19:05 changed by jjb

  • milestone changed from 1.0.1 to 1.1.1.

10/20/07 23:54:10 changed by jjb

  • keywords deleted.
  • priority changed from high to normal.
  • description changed.
  • milestone changed from 1.1.1 to 1.1.
Log in with username/password: lyceum/lyceum