From 9d46d7b06cafe4600f8c452c2bce79145e14e33a Mon Sep 17 00:00:00 2001 From: Bart van Bragt Date: Tue, 10 Dec 2002 11:13:58 +0000 Subject: [PATCH] Fixed some problems with gzip in combination with newer PHP versions and Mozilla git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3182 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/page_header_admin.php | 6 ++++-- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/page_header.php | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/phpBB/admin/page_header_admin.php b/phpBB/admin/page_header_admin.php index 73e6757b34..87ff439a7a 100644 --- a/phpBB/admin/page_header_admin.php +++ b/phpBB/admin/page_header_admin.php @@ -35,7 +35,9 @@ if ( $board_config['gzip_compress'] ) { $phpver = phpversion(); - if ( $phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible') ) + $useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT; + + if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) ) { if ( extension_loaded('zlib') ) { @@ -129,4 +131,4 @@ $template->assign_vars(array( $template->pparse('header'); -?> \ No newline at end of file +?> diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index ea5b6bb8fb..e35afeb7e8 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -138,6 +138,7 @@ h3 {font-size:12pt;color:blue}
  • Fixed incomplete deletion of PMs when removing the associated user
  • Fixed unread and new PM user counters to decrement appropriately in all situations
  • Fixed possible cross-site scripting issue with username search
  • +
  • Fixed some problems with gzip in combination with newer PHP versions and Mozilla
  • diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php index e90783d9d5..7ba0a31696 100644 --- a/phpBB/includes/page_header.php +++ b/phpBB/includes/page_header.php @@ -35,7 +35,9 @@ if ( $board_config['gzip_compress'] ) { $phpver = phpversion(); - if ( $phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible') ) + $useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT; + + if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) ) { if ( extension_loaded('zlib') ) {