aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorpaul sohier <paul999@phpbb.com>2020-01-02 15:21:34 +0100
committerpaul sohier <paul999@phpbb.com>2020-01-02 15:36:00 +0100
commitf866a8fd1bac7da74c88763447ad2f3ff1b9a10c (patch)
treea44ccad225e77725be342a9dad60b69eaef35d80 /phpBB/includes
parentdce0441ecf5fb3b163268be63552a85196dec020 (diff)
downloadforums-f866a8fd1bac7da74c88763447ad2f3ff1b9a10c.tar
forums-f866a8fd1bac7da74c88763447ad2f3ff1b9a10c.tar.gz
forums-f866a8fd1bac7da74c88763447ad2f3ff1b9a10c.tar.bz2
forums-f866a8fd1bac7da74c88763447ad2f3ff1b9a10c.tar.xz
forums-f866a8fd1bac7da74c88763447ad2f3ff1b9a10c.zip
[ticket/16287] After installation an error is given over statistics submission
The phpBB.com website required specific fields to be available for the statistics. This change switched over to a new statistics page on www.phpbb.com that uses form fields instead, and that returns JSON as value. PHPBB3-16287
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_help_phpbb.php11
-rw-r--r--phpBB/includes/questionnaire/questionnaire.php4
2 files changed, 9 insertions, 6 deletions
diff --git a/phpBB/includes/acp/acp_help_phpbb.php b/phpBB/includes/acp/acp_help_phpbb.php
index a36b36eddc..2b603d63f4 100644
--- a/phpBB/includes/acp/acp_help_phpbb.php
+++ b/phpBB/includes/acp/acp_help_phpbb.php
@@ -32,7 +32,7 @@ class acp_help_phpbb
include($phpbb_root_path . 'includes/questionnaire/questionnaire.' . $phpEx);
}
- $collect_url = "https://www.phpbb.com/stats/receive_stats.php";
+ $collect_url = "https://www.phpbb.com/statistics/send";
$this->tpl_name = 'acp_help_phpbb';
$this->page_title = 'ACP_HELP_PHPBB';
@@ -90,13 +90,15 @@ class acp_help_phpbb
if (!empty($response))
{
- if ((strpos($response, 'Thank you') !== false || strpos($response, 'Flood protection') !== false))
+ $decoded_response = json_decode($response, true);
+
+ if ($decoded_response && isset($decoded_response['status']) && $decoded_response['status'] == 'ok')
{
trigger_error($user->lang('THANKS_SEND_STATISTICS') . adm_back_link($this->u_action));
}
else
{
- trigger_error($user->lang('FAIL_SEND_STATISTICS') . adm_back_link($this->u_action));
+ trigger_error($user->lang('FAIL_SEND_STATISTICS') . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@@ -106,7 +108,8 @@ class acp_help_phpbb
$template->assign_vars(array(
'U_COLLECT_STATS' => $collect_url,
'S_COLLECT_STATS' => (!empty($config['help_send_statistics'])) ? true : false,
- 'RAW_DATA' => $collector->get_data_for_form(),
+ 'S_STATS' => $collector->get_data_raw(),
+ 'S_STATS_DATA' => json_encode($collector->get_data_raw()),
'U_ACP_MAIN' => append_sid("{$phpbb_admin_path}index.$phpEx"),
'U_ACTION' => $this->u_action,
// Pass earliest time we should try to send stats again
diff --git a/phpBB/includes/questionnaire/questionnaire.php b/phpBB/includes/questionnaire/questionnaire.php
index 95036a95bc..2bc95cf58f 100644
--- a/phpBB/includes/questionnaire/questionnaire.php
+++ b/phpBB/includes/questionnaire/questionnaire.php
@@ -68,7 +68,7 @@ class phpbb_questionnaire_data_collector
function get_data_for_form()
{
- return base64_encode(serialize($this->get_data_raw()));
+ return base64_encode(json_encode($this->get_data_raw()));
}
/**
@@ -124,7 +124,7 @@ class phpbb_questionnaire_php_data_provider
'zend.ze1_compatibility_mode' => (int) @ini_get('zend.ze1_compatibility_mode'),
'unicode.semantics' => (int) @ini_get('unicode.semantics'),
'zend_thread_safty' => (int) function_exists('zend_thread_id'),
- 'extensions' => get_loaded_extensions(),
+ 'extensions' => implode(",", get_loaded_extensions()),
);
}
}