better handling for 'view distinct' from table structure page

This commit is contained in:
Sebastian Mendel
2007-09-28 07:18:23 +00:00
parent 5262517b35
commit a375c17ea4
2 changed files with 26 additions and 20 deletions

View File

@@ -102,20 +102,7 @@ if (! empty($submit_mult)
require './tbl_alter.php';
break;
case $strBrowse:
$sql_query = '';
foreach ($selected AS $idx => $sval) {
if ($sql_query == '') {
$sql_query .= 'SELECT ' . PMA_backquote(urldecode($sval));
} else {
$sql_query .= ', ' . PMA_backquote(urldecode($sval));
}
}
// what is this htmlspecialchars() for??
//$sql_query .= ' FROM ' . PMA_backquote(htmlspecialchars($table));
$sql_query .= ' FROM ' . PMA_backquote($table);
require './sql.php';
break;
// this should already be handled by tbl_structure.php
}
} else {
$what = 'row_delete';

View File

@@ -35,15 +35,34 @@ if (isset($submit_mult_change_x)) {
$submit_mult = $strUnique;
} elseif (isset($submit_mult_fulltext_x)) {
$submit_mult = $strIdxFulltext;
} elseif (isset($submit_mult_browse_x)) {
$submit_mult = $strBrowse;
}
if ((!empty($submit_mult) && isset($selected_fld))
|| isset($mult_btn)) {
$action = 'tbl_structure.php';
if ((!empty($submit_mult) && isset($selected_fld)) || isset($mult_btn)) {
$err_url = 'tbl_structure.php?' . PMA_generate_common_url($db, $table);
require_once('./libraries/header.inc.php');
require_once './libraries/tbl_links.inc.php';
require './libraries/mult_submits.inc.php';
if ($submit_mult == $strBrowse) {
$GLOBALS['active_page'] = 'sql.php';
$sql_query = '';
foreach ($_REQUEST['selected_fld'] as $idx => $sval) {
if ($sql_query == '') {
$sql_query .= 'SELECT ' . PMA_backquote($sval);
} else {
$sql_query .= ', ' . PMA_backquote($sval);
}
}
// what is this htmlspecialchars() for??
//$sql_query .= ' FROM ' . PMA_backquote(htmlspecialchars($table));
$sql_query .= ' FROM ' . PMA_backquote($table);
require './sql.php';
} else {
$action = 'tbl_structure.php';
require_once './libraries/header.inc.php';
require_once './libraries/tbl_links.inc.php';
require './libraries/mult_submits.inc.php';
}
exit;
}
/**