Fix hang on unclosed quoted string (bug #1402270).

This commit is contained in:
Michal Čihař
2006-01-11 10:52:45 +00:00
parent eecff606d7
commit fb7ba99648
2 changed files with 10 additions and 1 deletions

View File

@@ -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 <lem9@users.sourceforge.net>
* libraries/sqlparser.lib.php: bug #1394479, problem detecting ending

View File

@@ -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--;