Default query can contain field names (RFE #948590, patch #961726).

This commit is contained in:
Michal Čihař
2004-05-28 14:08:32 +00:00
parent 8ed5e573fc
commit 566d4b4f33
4 changed files with 20 additions and 13 deletions

View File

@@ -139,12 +139,15 @@ if (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) {
<tr bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
<td valign="top"><textarea name="sql_query" rows="<?php echo $cfg['TextareaRows']; ?>" cols="<?php echo (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE ? ceil($cfg['TextareaCols'] * 1.25) : $cfg['TextareaCols'] * 2); ?>" dir="<?php echo $text_dir; ?>"<?php echo $auto_sel; ?>>
<?php
if (!empty($query_to_display)) {
if (! empty($query_to_display)) {
echo htmlspecialchars($query_to_display);
} elseif (isset($table)) {
echo htmlspecialchars(str_replace('%d', PMA_backquote($db), str_replace('%t', PMA_backquote($table), $cfg['DefaultQueryTable'])));
} else {
echo htmlspecialchars(str_replace('%d', PMA_backquote($db), $cfg['DefaultQueryDatabase']));
$query = str_replace('%d', PMA_backquote($db), $cfg['DefaultQueryDatabase']);
if (isset($table)) {
$query = str_replace('%f', implode(', ', PMA_backquote($fields_list)), $cfg['DefaultQueryTable']);
$query = str_replace('%t', PMA_backquote($table), $query);
}
echo htmlspecialchars($query);
}
?></textarea></td>
<?php if (isset($table) && $fields_cnt > 0) { ?>