From f58e0ae0fffb29893f970acf581fdad049946206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 6 Oct 2005 08:41:22 +0000 Subject: [PATCH] Fix handling of whitespace at the end of imported file. --- ChangeLog | 2 ++ libraries/import/sql.php | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 05b63db90..61dafff56 100755 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ $Source$ 2005-10-06 Michal Čihař * import.php: Correctly report that file could not be read. + * libraries/import/sql.php: Fix handling of whitespace at the end of + imported file. 2005-10-05 Marc Delisle * db_details_structure.php, tbl_properties_table_info.php: detect diff --git a/libraries/import/sql.php b/libraries/import/sql.php index f359874d2..8ad83672f 100644 --- a/libraries/import/sql.php +++ b/libraries/import/sql.php @@ -54,6 +54,12 @@ if (isset($import_list)) { if ($i == 2147483647) { $i = $oi; if (!$finished) break; + // at the end there might be some whitespace... + if (trim($buffer) == '') { + $buffer = ''; + $len = 0; + break; + } } // Grab current character