From: <nuc...@us...> - 2008-09-24 13:54:30
|
Revision: 5587 http://mantisbt.svn.sourceforge.net/mantisbt/?rev=5587&view=rev Author: nuclear_eclipse Date: 2008-09-24 13:54:22 +0000 (Wed, 24 Sep 2008) Log Message: ----------- Rudimentary IE detection to fix it whire using the right headers for Firefox/Opera/Etc. Modified Paths: -------------- branches/BRANCH_1_1_0/mantisbt/core.php Modified: branches/BRANCH_1_1_0/mantisbt/core.php =================================================================== --- branches/BRANCH_1_1_0/mantisbt/core.php 2008-09-23 23:33:22 UTC (rev 5586) +++ branches/BRANCH_1_1_0/mantisbt/core.php 2008-09-24 13:54:22 UTC (rev 5587) @@ -144,13 +144,29 @@ # OPENED ANYWHERE ELSE. require_once( $t_core_path.'database_api.php' ); + # Basic browser detection + $t_user_agent = $_SERVER['HTTP_USER_AGENT']; + + $t_browser_name = 'Normal'; + if ( strpos( $t_user_agent, 'MSIE' ) ) { + $t_browser_name = 'IE'; + } + # Headers to prevent caching # with option to bypass if running from script global $g_bypass_headers, $g_allow_browser_cache; if ( !isset( $g_bypass_headers ) && !headers_sent() ) { if ( isset( $g_allow_browser_cache ) ) { - header( 'Cache-Control: private, proxy-revalidate' ); + switch ( $t_browser_name ) { + case 'IE': + header( 'Cache-Control: private, proxy-revalidate' ); + break; + default: + header( 'Cache-Control: private, must-revalidate' ); + break; + } + } else { header( 'Cache-Control: no-store, no-cache, must-revalidate' ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |