diff --git a/ChangeLog b/ChangeLog index 75109bb18..14d87bc03 100755 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,8 @@ $Source$ * main.php, libraries/left_header.inc.php, libraries/select_server.lib.php: Show server selection if no server set and we have one server configuration (bug #1399880). + * libraries/import/sql.php: Fix hang on unclosed quoted string (bug + #1402270). 2006-01-10 Marc Delisle * libraries/sqlparser.lib.php: bug #1394479, problem detecting ending diff --git a/libraries/import/sql.php b/libraries/import/sql.php index 337674cc7..bad3193f8 100644 --- a/libraries/import/sql.php +++ b/libraries/import/sql.php @@ -78,7 +78,14 @@ if (isset($plugin_list)) { // Find next quote $pos = strpos($buffer, $quote, $i + 1); // No quote? Too short string - if ($pos === FALSE) break; + if ($pos === FALSE) { + // We hit end of string => unclosed quote, but we handle it as end of query + if ($finished) { + $endq = TRUE; + $i = $len - 1; + } + break; + } // Was not the quote escaped? $j = $pos - 1; while ($buffer[$j] == '\\') $j--;