Limit maximal numver of fields to 4096
Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
parent
28eb84ef43
commit
ff1016e504
@ -445,13 +445,16 @@ function PMA_getTableCreationQuery($db, $table)
|
||||
function PMA_getNumberOfFieldsFromRequest()
|
||||
{
|
||||
if (isset($_REQUEST['submit_num_fields'])) { // adding new fields
|
||||
$num_fields = $_REQUEST['orig_num_fields'] + $_REQUEST['added_fields'];
|
||||
$num_fields = min(
|
||||
4096,
|
||||
intval($_REQUEST['orig_num_fields']) + intval($_REQUEST['added_fields'])
|
||||
);
|
||||
} elseif (isset($_REQUEST['orig_num_fields'])) { // retaining existing fields
|
||||
$num_fields = $_REQUEST['orig_num_fields'];
|
||||
$num_fields = min(4096, intval($_REQUEST['orig_num_fields']));
|
||||
} elseif (isset($_REQUEST['num_fields'])
|
||||
&& intval($_REQUEST['num_fields']) > 0
|
||||
) { // new table with specified number of fields
|
||||
$num_fields = (int) $_REQUEST['num_fields'];
|
||||
$num_fields = min(4096, intval($_REQUEST['num_fields']));
|
||||
} else { // new table with unspecified number of fields
|
||||
$num_fields = 4;
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ if (isset($_REQUEST['getColumns'])) {
|
||||
exit;
|
||||
}
|
||||
if (isset($_REQUEST['splitColumn'])) {
|
||||
$num_fields = $_REQUEST['numFields'];
|
||||
$num_fields = min(4096, intval($_REQUEST['numFields']));
|
||||
$html = PMA_getHtmlForCreateNewColumn($num_fields, $db, $table);
|
||||
$html .= PMA_URL_getHiddenInputs($db, $table);
|
||||
echo $html;
|
||||
|
||||
@ -42,10 +42,13 @@ if (isset($_REQUEST['submit_num_fields'])) {
|
||||
if (isset($_REQUEST['orig_field_where'])) {
|
||||
$_REQUEST['field_where'] = $_REQUEST['orig_field_where'];
|
||||
}
|
||||
$num_fields = $_REQUEST['orig_num_fields'] + $_REQUEST['added_fields'];
|
||||
$num_fields = min(
|
||||
intval($_REQUEST['orig_num_fields']) + intval($_REQUEST['added_fields']),
|
||||
4096
|
||||
);
|
||||
$regenerate = true;
|
||||
} elseif (isset($_REQUEST['num_fields']) && intval($_REQUEST['num_fields']) > 0) {
|
||||
$num_fields = (int) $_REQUEST['num_fields'];
|
||||
$num_fields = min(4096, intval($_REQUEST['num_fields']));
|
||||
} else {
|
||||
$num_fields = 1;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user