From: <nuc...@us...> - 2008-09-23 23:36:36
|
Revision: 5586 http://mantisbt.svn.sourceforge.net/mantisbt/?rev=5586&view=rev Author: nuclear_eclipse Date: 2008-09-23 23:33:22 +0000 (Tue, 23 Sep 2008) Log Message: ----------- Rudimentary IE detection to fix it whire using the right headers for Firefox/Opera/Etc. Modified Paths: -------------- trunk/mantisbt/core.php Modified: trunk/mantisbt/core.php =================================================================== --- trunk/mantisbt/core.php 2008-09-23 23:17:49 UTC (rev 5585) +++ trunk/mantisbt/core.php 2008-09-23 23:33:22 UTC (rev 5586) @@ -184,13 +184,29 @@ list( $usec, $sec ) = explode( ' ', microtime() ); mt_srand( $sec*$usec ); + # 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. |