Commit 13fcfe757ab40dbe40f273caf60307a93e887202

Authored by Jalaloedien Abrahams
1 parent 9b2103c5

KTS-2210

"Cannot open document while using Internet Explorer"
Fixed. Removed cache control from ondiskhashedstoragemanager.inc.php

Committed By: Jalaloedien Abrahams
Reviewed By: Kevin Fourie

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7041 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/storage/ondiskhashedstoragemanager.inc.php
... ... @@ -144,25 +144,25 @@ class KTOnDiskHashedStorageManager extends KTStorageManager {
144 144 }
145 145  
146 146 if (file_exists($sPath)) {
147   -
148 147 $oUrlEncodedFileName = $oDocument->getFileName( );
149 148 $browser = $_SERVER['HTTP_USER_AGENT'];
150 149 if ( strpos( strtoupper( $browser), 'MSIE') !== false) {
151   - $oUrlEncodedFileName = htmlentities($oUrlEncodedFileName, ENT_QUOTES, 'UTF-8');
  150 + $oUrlEncodedFileName = htmlspecialchars($oUrlEncodedFileName, ENT_QUOTES, 'UTF-8');
152 151 }
153 152 //set the correct headers
154 153 header("Content-Type: " . $mimetype);
155 154 header("Content-Length: ". $oDocument->getFileSize());
156   - header("Content-Disposition: attachment; filename=\"" . $oUrlEncodedFileName . "\"");
  155 + header('Content-Disposition: attachment; filename="' . $oUrlEncodedFileName . '"');
157 156 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
158 157 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
159 158 // HTTP/1.1
160   - header("Cache-Control: no-store, no-cache, must-revalidate");
161   - header("Cache-Control: post-check=0, pre-check=0", false);
162   -
  159 + if ( strpos( strtoupper( $browser), 'MSIE') == false) {
  160 + header("Cache-Control: no-store, no-cache, must-revalidate");
  161 + header("Cache-Control: post-check=0, pre-check=0", false);
  162 + }
163 163 // HTTP/1.0
164   - // header("Pragma: no-cache"); // Don't send this header! It breaks IE.
165   -
  164 + //header("Pragma: no-cache"); // Don't send this header! It breaks IE.
  165 +
166 166 $oFile = new KTFSFileLike($sPath);
167 167 KTFileLikeUtil::send_contents($oFile);
168 168 } else {
... ...