aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_database.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2011-07-13 19:20:16 +0200
committerIgor Wiedler <igor@wiedler.ch>2011-07-15 22:34:24 +0200
commit0bf6966c5228d446c4f0d3862619db0f619c7369 (patch)
tree3f8adfb570262a9296e7a4fdb191804bfde7a4c0 /phpBB/includes/acp/acp_database.php
parent09e0460e5b53f83f4c06703c8bd8f1cb0f22eb48 (diff)
downloadforums-0bf6966c5228d446c4f0d3862619db0f619c7369.tar
forums-0bf6966c5228d446c4f0d3862619db0f619c7369.tar.gz
forums-0bf6966c5228d446c4f0d3862619db0f619c7369.tar.bz2
forums-0bf6966c5228d446c4f0d3862619db0f619c7369.tar.xz
forums-0bf6966c5228d446c4f0d3862619db0f619c7369.zip
[feature/request-class] Add server(), header() and is_ajax() to request
Extend the request class with helpers for reading server vars (server()) and HTTP request headers (header()). Refactor the existing code base to make use of these helpers, make $_SERVER a deactivated super global. Also introduce an is_ajax() method, which checks the X-Requested-With header for the value 'XMLHttpRequest', which is sent by JavaScript libraries, such as jQuery. PHPBB3-9716
Diffstat (limited to 'phpBB/includes/acp/acp_database.php')
-rw-r--r--phpBB/includes/acp/acp_database.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index 96542986d3..632578ef2d 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -486,6 +486,8 @@ class base_extractor
function base_extractor($download = false, $store = false, $format, $filename, $time)
{
+ global $request;
+
$this->download = $download;
$this->store = $store;
$this->time = $time;
@@ -530,7 +532,7 @@ class base_extractor
break;
case 'gzip':
- if ((isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'msie') === false)
+ if (strpos($request->header('Accept-Encoding'), 'gzip') !== false && strpos(strtolower($request->header('User-Agent')), 'msie') === false)
{
ob_start('ob_gzhandler');
}
@@ -1580,7 +1582,7 @@ class mssql_extractor extends base_extractor
}
$this->flush($sql_data);
}
-
+
function write_data_mssqlnative($table_name)
{
global $db;
@@ -1606,7 +1608,7 @@ class mssql_extractor extends base_extractor
$row = new result_mssqlnative($result_fields);
$i_num_fields = $row->num_fields();
-
+
for ($i = 0; $i < $i_num_fields; $i++)
{
$ary_type[$i] = $row->field_type($i);
@@ -1619,7 +1621,7 @@ class mssql_extractor extends base_extractor
WHERE COLUMNPROPERTY(object_id('$table_name'), COLUMN_NAME, 'IsIdentity') = 1";
$result2 = $db->sql_query($sql);
$row2 = $db->sql_fetchrow($result2);
-
+
if (!empty($row2['has_identity']))
{
$sql_data .= "\nSET IDENTITY_INSERT $table_name ON\nGO\n";
@@ -1683,8 +1685,8 @@ class mssql_extractor extends base_extractor
$sql_data .= "\nSET IDENTITY_INSERT $table_name OFF\nGO\n";
}
$this->flush($sql_data);
- }
-
+ }
+
function write_data_odbc($table_name)
{
global $db;