From 0bf6966c5228d446c4f0d3862619db0f619c7369 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Wed, 13 Jul 2011 19:20:16 +0200 Subject: [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 --- phpBB/style.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/style.php') diff --git a/phpBB/style.php b/phpBB/style.php index 62be0dde2b..caa45784de 100644 --- a/phpBB/style.php +++ b/phpBB/style.php @@ -152,7 +152,7 @@ if ($id) if ($config['gzip_compress']) { // IE6 is not able to compress the style (do not ask us why!) - $browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? strtolower(htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT'])) : ''; + $browser = strtolower($request->header('User-Agent', '', true)); if ($browser && strpos($browser, 'msie 6.0') === false && @extension_loaded('zlib') && !headers_sent()) { -- cgit v1.2.1 From c5cef773c4811d2041c56a9c34da94a30f8190e1 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 18 Aug 2011 23:38:39 +0200 Subject: [feature/request-class] Adjust code base to do html decoding manually PHPBB3-9716 --- phpBB/style.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/style.php') diff --git a/phpBB/style.php b/phpBB/style.php index caa45784de..eaab4544bc 100644 --- a/phpBB/style.php +++ b/phpBB/style.php @@ -152,7 +152,7 @@ if ($id) if ($config['gzip_compress']) { // IE6 is not able to compress the style (do not ask us why!) - $browser = strtolower($request->header('User-Agent', '', true)); + $browser = strtolower($request->header('User-Agent')); if ($browser && strpos($browser, 'msie 6.0') === false && @extension_loaded('zlib') && !headers_sent()) { -- cgit v1.2.1