aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2020-01-03 11:25:50 +0100
committerMarc Alexander <admin@m-a-styles.de>2020-01-03 11:25:50 +0100
commitb83de54bb4fd3217b41f61de896e73732752d196 (patch)
treeda7dc53e5d6804286f0abd500fa9b0efe767c799
parent261bf416ee4238c56df57e2d3cf4165b3a654e62 (diff)
parenta0ffbfce315ce45df4085d4c83536f2024e71a3f (diff)
downloadforums-b83de54bb4fd3217b41f61de896e73732752d196.tar
forums-b83de54bb4fd3217b41f61de896e73732752d196.tar.gz
forums-b83de54bb4fd3217b41f61de896e73732752d196.tar.bz2
forums-b83de54bb4fd3217b41f61de896e73732752d196.tar.xz
forums-b83de54bb4fd3217b41f61de896e73732752d196.zip
Merge pull request #5811 from paul999/ticket/16287
[ticket/16287] After installation an error message regarding statisti…
-rw-r--r--phpBB/adm/style/acp_help_phpbb.html10
-rw-r--r--phpBB/adm/style/ajax.js6
-rw-r--r--phpBB/includes/acp/acp_help_phpbb.php11
-rw-r--r--phpBB/includes/questionnaire/questionnaire.php4
4 files changed, 20 insertions, 11 deletions
diff --git a/phpBB/adm/style/acp_help_phpbb.html b/phpBB/adm/style/acp_help_phpbb.html
index 478ecc162a..7d3c503e77 100644
--- a/phpBB/adm/style/acp_help_phpbb.html
+++ b/phpBB/adm/style/acp_help_phpbb.html
@@ -38,10 +38,12 @@
<dd>{L_SEND_STATISTICS_LONG}</dd>
</dl>
</div>
+ <script>
+ var statsData = {{ S_STATS_DATA }};
+ </script>
<!-- EVENT acp_help_phpbb_stats_after -->
<fieldset>
<p class="submit-buttons">
- <input type="hidden" name="systemdata" value="{RAW_DATA}" />
<input type="hidden" name="help_send_statistics_time" value="{COLLECT_STATS_TIME}" />
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
</p>
@@ -52,7 +54,11 @@
<form action="{U_COLLECT_STATS}" method="post" target="questionaire_result" id="questionnaire-form">
<fieldset>
<p class="submit-buttons">
- <input type="hidden" name="systemdata" value="{RAW_DATA}" />
+ {% for providers in providers %}
+ {% for values in providers.values %}
+ <input type="hidden" name="{{ providers.NAME }}[{{ values.KEY }}]" value="{{ values.VALUE }}" />
+ {% endfor %}
+ {% endfor %}
<input class="button1" type="submit" id="submit_stats" name="submit" value="{L_SEND_STATISTICS}" />
</p>
</fieldset>
diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js
index 644e74bef7..39b63e4696 100644
--- a/phpBB/adm/style/ajax.js
+++ b/phpBB/adm/style/ajax.js
@@ -1,4 +1,4 @@
-/* global phpbb */
+/* global phpbb, statsData */
(function($) { // Avoid conflicts with other libraries
@@ -74,7 +74,7 @@ phpbb.prepareSendStats = function () {
var $sendStatisticsSuccess = $('<input />', {
type: 'hidden',
name: 'send_statistics_response',
- value: res
+ value: JSON.stringify(res)
});
$sendStatisticsSuccess.appendTo('p.submit-buttons');
@@ -87,7 +87,7 @@ phpbb.prepareSendStats = function () {
$.ajax({
url: $this.attr('data-ajax-action').replace('&amp;', '&'),
type: 'POST',
- data: 'systemdata=' + encodeURIComponent($this.find('input[name=systemdata]').val()),
+ data: statsData,
success: returnHandler,
error: errorHandler,
cache: false
diff --git a/phpBB/includes/acp/acp_help_phpbb.php b/phpBB/includes/acp/acp_help_phpbb.php
index a36b36eddc..798cff5cee 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(htmlspecialchars_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..ec2e6fea5d 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()),
);
}
}