It was always casting the result to an object, even when it was an empty array. I changed it to return null in this case. So that if (get_config('a_plugin')) { /* Do something relying on the pugin having config */ ) works.
- return (object)$localcfg;
+ if ($localcfg) {
+ return (object)$localcfg;
+ } else {
+ return null;
+ }
} else {
// this part is not really used any more, but anyway...
} else {
// this part is not really used any more, but anyway...