Commit 0d0cf076b705e6144376731bb2ea8de7f5ec79a3

Authored by kevin_fourie
1 parent 8280508b

Merged in from STABLE trunk...

KTS-3513
"Problems with "&" in a filename"
Fixed. The filename was being put through htmlspecialchars() for IE.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.5.3-Release-Branch@9013 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/storage/ondiskhashedstoragemanager.inc.php
... ... @@ -9,31 +9,31 @@
9 9 * Document Management Made Simple
10 10 * Copyright (C) 2008 KnowledgeTree Inc.
11 11 * Portions copyright The Jam Warehouse Software (Pty) Limited
12   - *
  12 + *
13 13 * This program is free software; you can redistribute it and/or modify it under
14 14 * the terms of the GNU General Public License version 3 as published by the
15 15 * Free Software Foundation.
16   - *
  16 + *
17 17 * This program is distributed in the hope that it will be useful, but WITHOUT
18 18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 19 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
20 20 * details.
21   - *
  21 + *
22 22 * You should have received a copy of the GNU General Public License
23 23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24   - *
25   - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
  24 + *
  25 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
26 26 * California 94120-7775, or email info@knowledgetree.com.
27   - *
  27 + *
28 28 * The interactive user interfaces in modified source and object code versions
29 29 * of this program must display Appropriate Legal Notices, as required under
30 30 * Section 5 of the GNU General Public License version 3.
31   - *
  31 + *
32 32 * In accordance with Section 7(b) of the GNU General Public License version 3,
33 33 * these Appropriate Legal Notices must retain the display of the "Powered by
34   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  34 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
35 35 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
36   - * must display the words "Powered by KnowledgeTree" and retain the original
  36 + * must display the words "Powered by KnowledgeTree" and retain the original
37 37 * copyright notice.
38 38 * Contributor( s): ______________________________________
39 39 */
... ... @@ -194,15 +194,12 @@ class KTOnDiskHashedStorageManager extends KTStorageManager {
194 194 }
195 195  
196 196 if (file_exists($sPath)) {
197   - $oUrlEncodedFileName = $oDocument->getFileName( );
198   - $browser = $_SERVER['HTTP_USER_AGENT'];
199   - if ( strpos( strtoupper( $browser), 'MSIE') !== false) {
200   - $oUrlEncodedFileName = htmlspecialchars($oUrlEncodedFileName, ENT_QUOTES, 'UTF-8');
201   - }
  197 + $sFileName = $oDocument->getFileName( );
  198 +
202 199 //set the correct headers
203 200 header("Content-Type: " . $mimetype);
204 201 header("Content-Length: ". $oDocument->getFileSize());
205   - header('Content-Disposition: attachment; filename="' . $oUrlEncodedFileName . '"');
  202 + header('Content-Disposition: attachment; filename="' . $sFileName . '"');
206 203 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
207 204 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
208 205 // HTTP/1.1
... ... @@ -215,8 +212,6 @@ class KTOnDiskHashedStorageManager extends KTStorageManager {
215 212  
216 213  
217 214 readfile($sPath);
218   - //$oFile = new KTFSFileLike($sPath);
219   - //KTFileLikeUtil::send_contents($oFile);
220 215 } else {
221 216 return false;
222 217 }
... ...