Return raw query in case of error (bug #1048826).

This commit is contained in:
Michal Čihař
2004-10-19 12:59:45 +00:00
parent f09d9c1aef
commit 330e83d6df
2 changed files with 16 additions and 14 deletions

View File

@@ -9,6 +9,8 @@ $Source$
* export.php: Use just \n for SQL exports (bug #1042521). * export.php: Use just \n for SQL exports (bug #1042521).
* libraries/read_dump.lib.php: Set correct return value (bug #1048861). * libraries/read_dump.lib.php: Set correct return value (bug #1048861).
* sql.php: Fix undefined index. * sql.php: Fix undefined index.
* libraries/sqlparser.lib.php: Return raw query in case of error (bug
#1048826).
2004-10-17 Marc Delisle <lem9@users.sourceforge.net> 2004-10-17 Marc Delisle <lem9@users.sourceforge.net>
* lang/turkish update, thanks to boralioglu. * lang/turkish update, thanks to boralioglu.

View File

@@ -1675,13 +1675,13 @@ if ($is_minimum_common == FALSE) {
function PMA_SQP_formatHtml($arr, $mode='color', $start_token=0, function PMA_SQP_formatHtml($arr, $mode='color', $start_token=0,
$number_of_tokens=-1) $number_of_tokens=-1)
{ {
// first check for the SQL parser having hit an error
if (PMA_SQP_isError()) {
return $arr;
}
// then check for an array // then check for an array
if (!is_array($arr)) { if (!is_array($arr)) {
return $arr; return htmlspecialchars($arr);
}
// first check for the SQL parser having hit an error
if (PMA_SQP_isError()) {
return htmlspecialchars($arr['raw']);
} }
// else do it properly // else do it properly
switch ($mode) { switch ($mode) {