diff --git a/ChangeLog b/ChangeLog index 6c065eeba..75eb590a4 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ $Source$ - updated the FPDF library to the 1.5 revision; - rewrote it to make it PHP3 and xhtml compliant; - coding standards. + * read_dump.php3, lines 245-252: improved the "open_basedir" handling. 2002-06-01 Alexander M. Turek * lang/indonesian.inc.php3: Updates, thanks to Rachim Tamsjadi. diff --git a/read_dump.php3 b/read_dump.php3 index 522247162..b40dab813 100644 --- a/read_dump.php3 +++ b/read_dump.php3 @@ -229,7 +229,7 @@ if ($sql_file != 'none') { if (file_exists($sql_file) && is_uploaded_file($sql_file)) { $open_basedir = ''; - if (PMA_PHP_INT_VERSION >= 40000 ) { + if (PMA_PHP_INT_VERSION >= 40000) { $open_basedir = @ini_get('open_basedir'); } if (empty($open_basedir)) { @@ -242,12 +242,14 @@ if ($sql_file != 'none') { if (!empty($open_basedir)) { // check if '.' is in open_basedir - $pos = strpos(' ' . $open_basedir, '.'); + $split_char = (PMA_IS_WINDOWS ? ';' : ':'); + $pos = ereg('(^|' . $split_char . ')\\.(' . $split_char . '|$)', $open_basedir); // from the PHP annotated manual if (!$pos) { - // if no '.' in openbasedir, do not move the file, force the - // error and let PHP report it + // if no '.' in openbasedir, do not move the file (open_basedir + // may only be a prefix), force the error and let PHP reports + // it error_reporting(E_ALL); $sql_query = fread(fopen($sql_file, 'r'), filesize($sql_file)); }