From 123ecb2be72f323992a27a66d92cd75b156ce09d Mon Sep 17 00:00:00 2001 From: chriskl Date: Mon, 11 Apr 2005 15:15:43 +0000 Subject: [PATCH] Fix dumping on v8 for windows, exclude dumping some objects. --- HISTORY | 1 + classes/Misc.php | 15 +++++++++++---- lang/english.php | 3 ++- lang/recoded/english.php | 3 ++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/HISTORY b/HISTORY index d645f735..9a1b76b2 100644 --- 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 diff --git a/classes/Misc.php b/classes/Misc.php index ad127a3f..5c604992 100644 --- a/classes/Misc.php +++ b/classes/Misc.php @@ -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 { @@ -1118,11 +1118,18 @@ * @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); diff --git a/lang/english.php b/lang/english.php index 0437bb21..7946eb15 100755 --- a/lang/english.php +++ b/lang/english.php @@ -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 @@ -144,6 +144,7 @@ $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'; diff --git a/lang/recoded/english.php b/lang/recoded/english.php index dd1a17f7..b038bfac 100644 --- a/lang/recoded/english.php +++ b/lang/recoded/english.php @@ -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 @@ -144,6 +144,7 @@ $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'; -- 2.39.5