From ae500544668f820651e1fe4d1df4d8f6056e6e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Tue, 11 Dec 2001 12:11:14 +0000 Subject: [PATCH] fixed bug #491051 - SQL Upload error last comment --- read_dump.php3 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/read_dump.php3 b/read_dump.php3 index f25b8757f..e44ef9309 100644 --- a/read_dump.php3 +++ b/read_dump.php3 @@ -101,13 +101,15 @@ function PMA_splitSqlFile(&$ret, $sql, $release) : strpos(' ' . $sql, "\015", $i+2); if (!$end_of_comment) { // no eol found after '#', add the parsed part to the returned - // array and exit - $ret[] = trim(substr($sql, 0, $i-1)); + // array if required and exit + if ($start_of_comment > 0) { + $ret[] = trim(substr($sql, 0, $start_of_comment)); + } return TRUE; } else { - $sql = substr($sql, 0, $start_of_comment) - . ltrim(substr($sql, $end_of_comment)); - $sql_len = strlen($sql); + $sql = substr($sql, 0, $start_of_comment) + . ltrim(substr($sql, $end_of_comment)); + $sql_len = strlen($sql); $i--; } // end if...else } // end else if (is comment) @@ -356,7 +358,7 @@ if (!empty($id_bookmark) && $action_bookmark == 2) { } else if (!isset($sql_query_cpy)) { $message = $strNoQuery; } else if ($sql_query_cpy == '') { - $message = "$strSuccess :
$strTheContent ($pieces_count $strInstructions) "; + $message = "$strSuccess :
$strTheContent ($pieces_count $strInstructions) "; } else { $message = $strSuccess; }