aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/questionnaire/questionnaire.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/questionnaire/questionnaire.php')
-rw-r--r--phpBB/includes/questionnaire/questionnaire.php47
1 files changed, 19 insertions, 28 deletions
diff --git a/phpBB/includes/questionnaire/questionnaire.php b/phpBB/includes/questionnaire/questionnaire.php
index 3268775cb6..63ea432863 100644
--- a/phpBB/includes/questionnaire/questionnaire.php
+++ b/phpBB/includes/questionnaire/questionnaire.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -88,7 +91,6 @@ class phpbb_questionnaire_data_collector
/**
* Questionnaire PHP data provider
-* @package phpBB3
*/
class phpbb_questionnaire_php_data_provider
{
@@ -132,7 +134,6 @@ class phpbb_questionnaire_php_data_provider
/**
* Questionnaire System data provider
-* @package phpBB3
*/
class phpbb_questionnaire_system_data_provider
{
@@ -148,23 +149,15 @@ class phpbb_questionnaire_system_data_provider
*/
function get_data()
{
- // Start discovering the IPV4 server address, if available
- $server_address = '0.0.0.0';
-
- if (!empty($_SERVER['SERVER_ADDR']))
- {
- $server_address = $_SERVER['SERVER_ADDR'];
- }
+ global $request;
- // Running on IIS?
- if (!empty($_SERVER['LOCAL_ADDR']))
- {
- $server_address = $_SERVER['LOCAL_ADDR'];
- }
+ // Start discovering the IPV4 server address, if available
+ // Try apache, IIS, fall back to 0.0.0.0
+ $server_address = htmlspecialchars_decode($request->server('SERVER_ADDR', $request->server('LOCAL_ADDR', '0.0.0.0')));
return array(
'os' => PHP_OS,
- 'httpd' => $_SERVER['SERVER_SOFTWARE'],
+ 'httpd' => htmlspecialchars_decode($request->server('SERVER_SOFTWARE')),
// we don't want the real IP address (for privacy policy reasons) but only
// a network address to see whether your installation is running on a private or public network.
'private_ip' => $this->is_private_ip($server_address),
@@ -220,7 +213,6 @@ class phpbb_questionnaire_system_data_provider
/**
* Questionnaire phpBB data provider
-* @package phpBB3
*/
class phpbb_questionnaire_phpbb_data_provider
{
@@ -265,10 +257,13 @@ class phpbb_questionnaire_phpbb_data_provider
*/
function get_data()
{
- global $phpbb_root_path, $phpEx;
- include("{$phpbb_root_path}config.$phpEx");
+ global $phpbb_root_path, $phpEx, $phpbb_config_php_file;
+
+ extract($phpbb_config_php_file->get_all());
unset($dbhost, $dbport, $dbname, $dbuser, $dbpasswd); // Just a precaution
+ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
+
// Only send certain config vars
$config_vars = array(
'active_sessions' => true,
@@ -313,7 +308,6 @@ class phpbb_questionnaire_phpbb_data_provider
'avatar_max_width' => true,
'avatar_min_height' => true,
'avatar_min_width' => true,
- 'board_dst' => true,
'board_email_form' => true,
'board_hide_emails' => true,
'board_timezone' => true,
@@ -482,17 +476,16 @@ class phpbb_questionnaire_phpbb_data_provider
}
}
- global $db;
+ global $db, $request;
$result['dbms'] = $dbms;
$result['acm_type'] = $acm_type;
- $result['load_extensions'] = $load_extensions;
$result['user_agent'] = 'Unknown';
$result['dbms_version'] = $db->sql_server_info(true);
// Try to get user agent vendor and version
$match = array();
- $user_agent = (!empty($_SERVER['HTTP_USER_AGENT'])) ? (string) $_SERVER['HTTP_USER_AGENT'] : '';
+ $user_agent = $request->header('User-Agent');
$agents = array('firefox', 'msie', 'opera', 'chrome', 'safari', 'mozilla', 'seamonkey', 'konqueror', 'netscape', 'gecko', 'navigator', 'mosaic', 'lynx', 'amaya', 'omniweb', 'avant', 'camino', 'flock', 'aol');
// We check here 1 by 1 because some strings occur after others (for example Mozilla [...] Firefox/)
@@ -508,5 +501,3 @@ class phpbb_questionnaire_phpbb_data_provider
return $result;
}
}
-
-?> \ No newline at end of file