From ccba042ddeadd1b2562aec789969c65ca2960c01 Mon Sep 17 00:00:00 2001 From: chriskl Date: Thu, 4 Nov 2004 02:56:50 +0000 Subject: [PATCH] work around MSIE being broken for downloads in SSL mode --- HISTORY | 1 + database.php | 9 ++++++--- dataexport.php | 25 ++++++++++++++++--------- dbexport.php | 14 +++++++++++--- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/HISTORY b/HISTORY index d3c3e356..a57a944c 100644 --- a/HISTORY +++ b/HISTORY @@ -40,6 +40,7 @@ Translations Bugs * Fix that non-Auto mode import didn't work (Adrian Nida) * Fix inability to drop constraints when using a non-english translation +* Work around MSIE's failure to handle downloads in SSL mode Version 3.4.1 ------------- diff --git a/database.php b/database.php index 3ff15be4..47baac7d 100755 --- a/database.php +++ b/database.php @@ -3,7 +3,7 @@ /** * Manage schemas within a database * - * $Id: database.php,v 1.63 2004/09/07 13:58:21 jollytoad Exp $ + * $Id: database.php,v 1.64 2004/11/04 02:56:50 chriskl Exp $ */ // Include application functions @@ -312,8 +312,11 @@ echo "

{$lang['stroptions']}

\n"; echo "

{$lang['strshow']}\n"; echo "
{$lang['strdownload']}\n"; - echo "
{$lang['strdownloadgzipped']}

\n"; - + // MSIE cannot download gzip in SSL mode - it's just broken + if (!(strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') && isset($_SERVER['HTTPS']))) { + echo "
{$lang['strdownloadgzipped']}\n"; + } + echo "

\n"; echo "

\n"; echo "

\n"; echo $misc->form; diff --git a/dataexport.php b/dataexport.php index c2272a0f..9d4ca5d6 100644 --- a/dataexport.php +++ b/dataexport.php @@ -4,7 +4,7 @@ * Does an export to the screen or as a download. This checks to * see if they have pg_dump set up, and will use it if possible. * - * $Id: dataexport.php,v 1.16 2004/08/04 07:44:03 chriskl Exp $ + * $Id: dataexport.php,v 1.17 2004/11/04 02:56:51 chriskl Exp $ */ $extensions = array( @@ -93,14 +93,21 @@ // Make it do a download, if necessary if ($_REQUEST['output'] == 'download') { - header('Content-Type: application/download'); - - if (isset($extensions[$format])) - $ext = $extensions[$format]; - else - $ext = 'txt'; - - header('Content-Disposition: attachment; filename=dump.' . $ext); + // Set headers. MSIE is totally broken for SSL downloading, so + // we need to have it download in-place as plain text + if (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') && isset($_SERVER['HTTPS'])) { + header('Content-Type: text/plain'); + } + else { + header('Content-Type: application/download'); + + if (isset($extensions[$format])) + $ext = $extensions[$format]; + else + $ext = 'txt'; + + header('Content-Disposition: attachment; filename=dump.' . $ext); + } } else { header('Content-Type: text/plain'); diff --git a/dbexport.php b/dbexport.php index 9f61d0f4..f8fa5315 100644 --- a/dbexport.php +++ b/dbexport.php @@ -3,7 +3,7 @@ * Does an export of a database or a table (via pg_dump) * to the screen or as a download. * - * $Id: dbexport.php,v 1.13 2004/10/06 08:39:49 jollytoad Exp $ + * $Id: dbexport.php,v 1.14 2004/11/04 02:56:51 chriskl Exp $ */ // Include application functions @@ -19,10 +19,18 @@ header('Content-Type: text/plain'); break; case 'download': - header('Content-Type: application/download'); - header('Content-Disposition: attachment; filename=dump.sql'); + // Set headers. MSIE is totally broken for SSL downloading, so + // we need to have it download in-place as plain text + if (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') && isset($_SERVER['HTTPS'])) { + header('Content-Type: text/plain'); + } + else { + header('Content-Type: application/download'); + header('Content-Disposition: attachment; filename=dump.sql'); + } break; case 'gzipped': + // MSIE in SSL mode cannot do this - it should never get to this point header('Content-Type: application/download'); header('Content-Disposition: attachment; filename=dump.sql.gz'); break; -- 2.39.5