Fix hang on unclosed quoted string (bug #1402270).
This commit is contained in:
@@ -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
|
||||
|
@@ -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--;
|
||||
|
Reference in New Issue
Block a user