From: Mikael Nordfeldth Date: Tue, 19 Nov 2013 12:50:49 +0000 (+0100) Subject: Plugins should be initialized with an empty array, not null X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=450ae3043bb3e336ac59e93601889a904686643b;p=quix0rs-gnu-social.git Plugins should be initialized with an empty array, not null --- diff --git a/lib/default.php b/lib/default.php index 005a3683d8..dcdd58478c 100644 --- a/lib/default.php +++ b/lib/default.php @@ -293,9 +293,9 @@ $default = array('disabled' => true), 'plugins' => array('core' => array( - 'AuthCrypt' => null, - 'LRDD' => null, - 'StrictTransportSecurity' => null, + 'AuthCrypt' => array(), + 'LRDD' => array(), + 'StrictTransportSecurity' => array(), ), 'default' => array( 'Activity' => array(), diff --git a/lib/siteprofile.php b/lib/siteprofile.php index 087dca4858..ae32acdf76 100644 --- a/lib/siteprofile.php +++ b/lib/siteprofile.php @@ -110,10 +110,10 @@ class PublicSite extends SiteProfileSettings 'plugins' => array( 'core' => self::corePlugins(), 'default' => array_merge(self::defaultPlugins(), array( - 'Directory' => null, - 'ExtendedProfile' => null, - 'OStatus' => null, - 'WebFinger' => null, + 'Directory' => array(), + 'ExtendedProfile' => array(), + 'OStatus' => array(), + 'WebFinger' => array(), )) ), 'discovery' => array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.) @@ -146,10 +146,10 @@ class PrivateSite extends SiteProfileSettings 'plugins' => array( 'core' => self::corePlugins(), 'default' => array_merge(self::defaultPlugins(), array( - 'Directory' => null, - 'ExtendedProfile' => null, - 'EmailRegistration' => null, - 'MobileProfile' => null, + 'Directory' => array(), + 'ExtendedProfile' => array(), + 'EmailRegistration' => array(), + 'MobileProfile' => array(), )) ), 'profile' => array('delete' => 'true'), @@ -197,9 +197,9 @@ class CommunitySite extends SiteProfileSettings 'plugins' => array( 'core' => self::corePlugins(), 'default' => array_merge(self::defaultPlugins(), array( - 'Directory' => null, - 'OStatus' => null, - 'WebFinger' => null, + 'Directory' => array(), + 'OStatus' => array(), + 'WebFinger' => array(), )) ), 'discovery' => array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.) @@ -232,11 +232,11 @@ class SingleuserSite extends SiteProfileSettings 'plugins' => array( 'core' => self::corePlugins(), 'default' => array_merge(self::defaultPlugins(), array( - 'MobileProfile' => null, - 'OStatus' => null, - 'TwitterBridge' => null, - 'FacebookBridge' => null, - 'WebFinger' => null, + 'MobileProfile' => array(), + 'OStatus' => array(), + 'TwitterBridge' => array(), + 'FacebookBridge' => array(), + 'WebFinger' => array(), )) ), 'discovery' => array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.) diff --git a/lib/statusnet.php b/lib/statusnet.php index e596dd96d1..9041a556cc 100644 --- a/lib/statusnet.php +++ b/lib/statusnet.php @@ -205,6 +205,8 @@ class StatusNet continue; } + // TODO: We should be able to avoid this is_null and assume $params + // is an array, since that's how it is typed in addPlugin if (is_null($params)) { self::addPlugin($name); } else if (is_array($params)) {