diff --git a/ChangeLog b/ChangeLog index 2c6c2b928..081e15ed0 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ phpMyAdmin - Changelog $Id$ $Source$ +2003-07-28 Garvin Hicking + * sql.php3, libraries/common.lib.php3 - when $cfg['SQP']['fmtType'] + is set to 'none', positively retain any user formatting for query + output. (RFE #769219) + 2003-07-28 Marc Delisle * sql.php3: bug 778899, could not create a bookmark * ldi_table.php3: Users with register_global=off received some diff --git a/libraries/common.lib.php3 b/libraries/common.lib.php3 index b740b9d4b..9f0d7cdab 100644 --- a/libraries/common.lib.php3 +++ b/libraries/common.lib.php3 @@ -345,10 +345,10 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold} * * @author Robin Johnson */ - function PMA_formatSql($parsed_sql) + function PMA_formatSql($parsed_sql, $unparsed_sql = '') { global $cfg; - + // Check that we actually have a valid set of parsed data // well, not quite // first check for the SQL parser having hit an error @@ -360,7 +360,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold} // We don't so just return the input directly // This is intended to be used for when the SQL Parser is turned off $formatted_sql = '
' . "\n"
-                                . $parsed_sql . "\n"
+                                . (($cfg['SQP']['fmtType'] == 'none' && $unparsed_sql != '') ? $unparsed_sql : $parsed_sql) . "\n"
                                 . '
'; return $formatted_sql; } @@ -369,7 +369,11 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold} switch ($cfg['SQP']['fmtType']) { case 'none': - $formatted_sql = PMA_SQP_formatNone($parsed_sql); + if ($unparsed_sql != '') { + $formatted_sql = "
\n" . PMA_SQP_formatNone(array('raw' => $unparsed_sql)) . "\n
"; + } else { + $formatted_sql = PMA_SQP_formatNone($parsed_sql); + } break; case 'html': $formatted_sql = PMA_SQP_formatHtml($parsed_sql,'color'); @@ -447,7 +451,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold} } // end if echo '

' . "\n" . '

' . "\n" - . ' ' . PMA_formatSql($parsed_sql) . "\n" + . ' ' . PMA_formatSql($parsed_sql, $the_query) . "\n" . '

' . "\n"; } // end if if (!empty($error_message)) { @@ -1317,7 +1321,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}