work around MSIE being broken for downloads in SSL mode
authorchriskl <chriskl>
Thu, 4 Nov 2004 02:56:50 +0000 (02:56 +0000)
committerchriskl <chriskl>
Thu, 4 Nov 2004 02:56:50 +0000 (02:56 +0000)
HISTORY
database.php
dataexport.php
dbexport.php

diff --git a/HISTORY b/HISTORY
index d3c3e3568371afdb3a14fdc4fb10dc5da6bb07a5..a57a944c3ed9fecc9caafd0abf0ad68552c6551e 100644 (file)
--- 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
 -------------
index 3ff15be41ed8ef4e5571891cc2179f7eaa3447e1..47baac7d066ef0658de6684698ca3fa273c67588 100755 (executable)
@@ -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
                echo "<h3>{$lang['stroptions']}</h3>\n";
                echo "<p><input type=\"radio\" name=\"output\" value=\"show\" checked=\"checked\" />{$lang['strshow']}\n";
                echo "<br/><input type=\"radio\" name=\"output\" value=\"download\" />{$lang['strdownload']}\n";
-               echo "<br /><input type=\"radio\" name=\"output\" value=\"gzipped\" />{$lang['strdownloadgzipped']}</p>\n";
-
+               // MSIE cannot download gzip in SSL mode - it's just broken
+               if (!(strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') && isset($_SERVER['HTTPS']))) {
+                       echo "<br /><input type=\"radio\" name=\"output\" value=\"gzipped\" />{$lang['strdownloadgzipped']}\n";
+               }
+               echo "</p>\n";
                echo "<p><input type=\"hidden\" name=\"action\" value=\"export\" />\n";
                echo "<p><input type=\"hidden\" name=\"mode\" value=\"database\" />\n";         
                echo $misc->form;
index c2272a0fc338ebd748924c17d0852c1b4b538298..9d4ca5d6989a826cb2db76d17ff46c37d685890f 100644 (file)
@@ -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(
 
                // 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 {\r
+                               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');
index 9f61d0f43010d555737692b7da82949a67cfae66..f8fa5315c05b434e9cf3b436813efaf8c53b1c35 100644 (file)
@@ -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
                                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;