diff --git a/ChangeLog b/ChangeLog index 3d9f5e60c..82fe06a5b 100755 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,7 @@ $Source$ 2002-11-11 Marc Delisle * libraries/sqlparser.lib.php3: LEFT JOIN ... USING - * libraries/sqlparser.lib.php3: bug 636575 (double quotes) + * libraries/sqlparser.lib.php3: bug 636575 (double and single quotes) 2002-11-10 Alexander M. Turek * lang/german-*.inc.php3: Fixed a typo. diff --git a/libraries/sqlparser.lib.php3 b/libraries/sqlparser.lib.php3 index 8826c3d2c..ed918f153 100644 --- a/libraries/sqlparser.lib.php3 +++ b/libraries/sqlparser.lib.php3 @@ -700,6 +700,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) { // ============================== if (($arr[$i]['type'] == 'quote_backtick') || ($arr[$i]['type'] == 'quote_double') + || ($arr[$i]['type'] == 'quote_single') || ($arr[$i]['type'] == 'alpha_identifier')) { //TODO: check embedded double quotes or backticks? @@ -714,6 +715,11 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) { $identifier = str_replace('"','',$arr[$i]['data']); } + if ($arr[$i]['type'] == 'quote_single') { + // remove single quotes + $identifier = str_replace("'","",$arr[$i]['data']); + } + if ($subresult['querytype'] == 'SELECT') { if (!$seen_from) { if ($previous_was_identifier) { @@ -884,6 +890,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) { // token is not an identifier if (($arr[$i]['type'] != 'alpha_identifier') && ($arr[$i]['type'] != 'quote_double') + && ($arr[$i]['type'] != 'quote_single') && ($arr[$i]['type'] != 'quote_backtick')) { $previous_was_identifier = FALSE; } // end if