Skip to content
Permalink
Browse files

Retrieve parameters from $_POST in table_row_action

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
  • Loading branch information...
mauriciofauth committed Jul 19, 2018
1 parent 3d9ed65 commit b72e55acf82a67fcb9d8eb341878f8e9fc7af295
Showing with 18 additions and 18 deletions.
  1. +18 −18 tbl_row_action.php
@@ -15,20 +15,20 @@
*/
require_once 'libraries/common.inc.php';
if (isset($_REQUEST['submit_mult'])) {
$submit_mult = $_REQUEST['submit_mult'];
if (isset($_POST['submit_mult'])) {
$submit_mult = $_POST['submit_mult'];
// workaround for IE problem:
} elseif (isset($_REQUEST['submit_mult_delete_x'])) {
} elseif (isset($_POST['submit_mult_delete_x'])) {
$submit_mult = 'row_delete';
} elseif (isset($_REQUEST['submit_mult_change_x'])) {
} elseif (isset($_POST['submit_mult_change_x'])) {
$submit_mult = 'row_edit';
} elseif (isset($_REQUEST['submit_mult_export_x'])) {
} elseif (isset($_POST['submit_mult_export_x'])) {
$submit_mult = 'row_export';
}
// If the 'Ask for confirmation' button was pressed, this can only come
// from 'delete' mode, so we set it straight away.
if (isset($_REQUEST['mult_btn'])) {
if (isset($_POST['mult_btn'])) {
$submit_mult = 'row_delete';
}
@@ -64,9 +64,9 @@
if (!empty($submit_mult)) {
if (isset($_REQUEST['goto'])
&& (! isset($_REQUEST['rows_to_delete'])
|| ! is_array($_REQUEST['rows_to_delete']))
if (isset($_POST['goto'])
&& (! isset($_POST['rows_to_delete'])
|| ! is_array($_POST['rows_to_delete']))
) {
$response = Response::getInstance();
$response->setRequestStatus(false);
@@ -76,18 +76,18 @@
switch($submit_mult) {
/** @noinspection PhpMissingBreakStatementInspection */
case 'row_copy':
$_REQUEST['default_action'] = 'insert';
$_POST['default_action'] = 'insert';
// no break to allow for fallthough
case 'row_edit':
// As we got the rows to be edited from the
// 'rows_to_delete' checkbox, we use the index of it as the
// indicating WHERE clause. Then we build the array which is used
// for the tbl_change.php script.
$where_clause = array();
if (isset($_REQUEST['rows_to_delete'])
&& is_array($_REQUEST['rows_to_delete'])
if (isset($_POST['rows_to_delete'])
&& is_array($_POST['rows_to_delete'])
) {
foreach ($_REQUEST['rows_to_delete'] as $i => $i_where_clause) {
foreach ($_POST['rows_to_delete'] as $i => $i_where_clause) {
$where_clause[] = $i_where_clause;
}
}
@@ -104,10 +104,10 @@
// indicating WHERE clause. Then we build the array which is used
// for the tbl_change.php script.
$where_clause = array();
if (isset($_REQUEST['rows_to_delete'])
&& is_array($_REQUEST['rows_to_delete'])
if (isset($_POST['rows_to_delete'])
&& is_array($_POST['rows_to_delete'])
) {
foreach ($_REQUEST['rows_to_delete'] as $i => $i_where_clause) {
foreach ($_POST['rows_to_delete'] as $i => $i_where_clause) {
$where_clause[] = $i_where_clause;
}
}
@@ -120,7 +120,7 @@
$action = 'tbl_row_action.php';
$err_url = 'tbl_row_action.php'
. Url::getCommon($GLOBALS['url_params']);
if (! isset($_REQUEST['mult_btn'])) {
if (! isset($_POST['mult_btn'])) {
$original_sql_query = $sql_query;
if (! empty($url_query)) {
$original_url_query = $url_query;
@@ -136,7 +136,7 @@
* Show result of multi submit operation
*/
// sql_query is not set when user does not confirm multi-delete
if ((! empty($submit_mult) || isset($_REQUEST['mult_btn']))
if ((! empty($submit_mult) || isset($_POST['mult_btn']))
&& ! empty($sql_query)
) {
$disp_message = __('Your SQL query has been executed successfully.');

0 comments on commit b72e55a

Please sign in to comment.
You can’t perform that action at this time.