From: Zach Copley Date: Thu, 22 Sep 2011 19:49:04 +0000 (-0700) Subject: Use array_merge instead of array_replace (same effect, and array_merge works with... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8e501584b4537750fbd0ca3954e1426b723d5dad;p=quix0rs-gnu-social.git Use array_merge instead of array_replace (same effect, and array_merge works with PHP versions < 5.3) fixes http://status.net/open-source/issues/3393 --- diff --git a/lib/siteprofile.php b/lib/siteprofile.php index 51ce907b19..b5c6fc304c 100644 --- a/lib/siteprofile.php +++ b/lib/siteprofile.php @@ -90,7 +90,7 @@ class PublicSite extends SiteProfileSettings global $config; return array( // We only want to change these values, not replace entire 'site' array - 'site' => array_replace( + 'site' => array_merge( $config['site'], array( 'inviteonly' => false, 'private' => false, @@ -137,7 +137,7 @@ class PrivateSite extends SiteProfileSettings global $config; return array( // We only want to change these values, not replace entire 'site' array - 'site' => array_replace( + 'site' => array_merge( $config['site'], array( 'inviteonly' => true, 'private' => true, @@ -200,7 +200,7 @@ class CommunitySite extends SiteProfileSettings global $config; return array( // We only want to change these values, not replace entire 'site' array - 'site' => array_replace( + 'site' => array_merge( $config['site'], array( 'private' => false, 'closed' => false @@ -245,7 +245,7 @@ class SingleuserSite extends SiteProfileSettings return array( 'singleuser' => array('enabled' => true), // We only want to change these values, not replace entire 'site' array - 'site' => array_replace( + 'site' => array_merge( $config['site'], array( 'private' => false, 'closed' => true, diff --git a/lib/statusnet.php b/lib/statusnet.php index e4fb60ec7c..bffa625773 100644 --- a/lib/statusnet.php +++ b/lib/statusnet.php @@ -310,7 +310,7 @@ class StatusNet { global $config; $settings = SiteProfile::getSettings($name); - $config = array_replace($config, $settings); + $config = array_merge($config, $settings); } protected function _sn_to_path($sn)