diff --git a/lib/Helpscout/Beacon.php b/lib/Helpscout/Beacon.php index dc2ea569ae..e3f8384de8 100644 --- a/lib/Helpscout/Beacon.php +++ b/lib/Helpscout/Beacon.php @@ -20,7 +20,7 @@ class Beacon { CronDaemon::ACTION_PING ); $cron_ping_url = str_replace(home_url(), CronHelper::getSiteUrl(), $cron_ping_url); - $beacon_data = array( + return array( 'name' => $current_user->display_name, 'email' => $current_user->user_email, 'PHP version' => PHP_VERSION, @@ -29,7 +29,7 @@ class Beacon { 'WordPress version' => get_bloginfo('version'), 'Database version' => $db_version, 'Web server' => (!empty($_SERVER["SERVER_SOFTWARE"])) ? $_SERVER["SERVER_SOFTWARE"] : 'N/A', - 'Server OS' => (function_exists('php_uname')) ? php_uname() : 'N/A', + 'Server OS' => (function_exists('php_uname')) ? utf8_encode(php_uname()) : 'N/A', 'WP_MEMORY_LIMIT' => WP_MEMORY_LIMIT, 'WP_MAX_MEMORY_LIMIT' => WP_MAX_MEMORY_LIMIT, 'WP_DEBUG' => WP_DEBUG, @@ -54,7 +54,5 @@ class Beacon { 'Bounce Email Address' => Setting::getValue('bounce.address'), 'Total number of subscribers' => Subscriber::getTotalSubscribers() ); - - return array_map('utf8_encode', $beacon_data); } } \ No newline at end of file diff --git a/tests/unit/Helpscout/BeaconTest.php b/tests/unit/Helpscout/BeaconTest.php index 65f8e3c55f..e4589e9eb2 100644 --- a/tests/unit/Helpscout/BeaconTest.php +++ b/tests/unit/Helpscout/BeaconTest.php @@ -116,7 +116,7 @@ class BeaconTest extends MailPoetTest { } function testItReturnsServerOSInformation() { - expect($this->beacon_data['Server OS'])->equals(php_uname()); + expect($this->beacon_data['Server OS'])->equals(utf8_encode(php_uname())); } function testItReturnsCronPingResponse() {