Fix dumping on v8 for windows, exclude dumping some objects.
authorchriskl <chriskl>
Mon, 11 Apr 2005 15:15:43 +0000 (15:15 +0000)
committerchriskl <chriskl>
Mon, 11 Apr 2005 15:15:43 +0000 (15:15 +0000)
HISTORY
classes/Misc.php
lang/english.php
lang/recoded/english.php

diff --git a/HISTORY b/HISTORY
index d645f735d4cb5fa9514e5d392f20ce41cf3a87f7..9a1b76b244629e1d8684d72e40e885c85ec1951d 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -31,6 +31,7 @@ Bugs
 * Stop duplicate insert on re-POST of data
 * Correct last internal oid value for PostgreSQL 8.0
 * Fix bug with exporting schema for servers < 7.3
+* Fix dumping on v8 for windows, exclude dumping some objects.
 
 Translations
 * Japanese from Tadashi Jokagi
index ad127a3f3740a43aaab598a06fa83aac1db4dd56..5c604992af2e4a757300484eaa17d155f76dec94 100644 (file)
@@ -2,7 +2,7 @@
        /**
         * Class to hold various commonly used functions
         *
-        * $Id: Misc.php,v 1.98 2005/01/23 12:42:35 soranzo Exp $
+        * $Id: Misc.php,v 1.99 2005/04/11 15:15:44 chriskl Exp $
         */
         
        class Misc {
                 * @return The escaped string
                 */
                function escapeShellArg($str) {
-                       global $data;
+                       global $data, $lang;
                        
                        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
-                               $data->fieldClean($str);
-                               return '"' . $str . '"';
+                               // Due to annoying PHP bugs, shell arguments cannot be escaped
+                               // (command simply fails), so we cannot allow complex objects
+                               // to be dumped.
+                               if (ereg('^[_.[:alnum:]]+$', $str))
+                                       return $str;
+                               else {
+                                       echo $lang['strcannotdumponwindows'];
+                                       exit;
+                               }                               
                        }
                        else    
                                return escapeshellarg($str);
index 0437bb2127ae8ccebda27d27dcb465524e94419a..7946eb15a5988a1704306d995ea1d861ad278b4b 100755 (executable)
@@ -4,7 +4,7 @@
         * English language file for phpPgAdmin.  Use this as a basis
         * for new translations.
         *
-        * $Id: english.php,v 1.170 2005/03/13 23:15:17 mr-russ Exp $
+        * $Id: english.php,v 1.171 2005/04/11 15:15:45 chriskl Exp $
         */
 
        // Language and character set
        $lang['strnouploads'] = 'File uploads are disabled.';
        $lang['strimporterror'] = 'Import error.';
        $lang['strimporterrorline'] = 'Import error on line %s.';
+       $lang['strcannotdumponwindows'] = 'Dumping of complex database names on Windows is not supported.  Please see the FAQ.';
 
        // Tables
        $lang['strtable'] = 'Table';
index dd1a17f703723107f4d0c35dce25c842d402c2d3..b038bfac4d1dbad9c2c55ac0b57eac41d869d524 100644 (file)
@@ -4,7 +4,7 @@
         * English language file for phpPgAdmin.  Use this as a basis
         * for new translations.
         *
-        * $Id: english.php,v 1.122 2005/01/04 23:49:21 soranzo Exp $
+        * $Id: english.php,v 1.123 2005/04/11 15:15:47 chriskl Exp $
         */
 
        // Language and character set
        $lang['strnouploads'] = 'File uploads are disabled.';
        $lang['strimporterror'] = 'Import error.';
        $lang['strimporterrorline'] = 'Import error on line %s.';
+       $lang['strcannotdumponwindows'] = 'Dumping of complex database, schema or table names on Windows is not supported.  Please see the FAQ.';
 
        // Tables
        $lang['strtable'] = 'Table';