Remove useless foreach

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
Kamil Tekiela 2023-05-11 22:45:59 +01:00
parent 4095a901bb
commit 4a4f8ae063
2 changed files with 4 additions and 6 deletions

View File

@ -11,6 +11,7 @@ use PhpMyAdmin\Template;
use PhpMyAdmin\Url;
use function __;
use function array_values;
use function is_array;
final class ChangeRowsController extends AbstractController
@ -41,9 +42,7 @@ final class ChangeRowsController extends AbstractController
// for the /table/change script.
$GLOBALS['where_clause'] = [];
if (isset($_POST['rows_to_delete']) && is_array($_POST['rows_to_delete'])) {
foreach ($_POST['rows_to_delete'] as $eachWhereClause) {
$GLOBALS['where_clause'][] = $eachWhereClause;
}
$GLOBALS['where_clause'] = array_values($_POST['rows_to_delete']);
}
$GLOBALS['active_page'] = Url::getFromRoute('/table/change');

View File

@ -11,6 +11,7 @@ use PhpMyAdmin\Template;
use PhpMyAdmin\Url;
use function __;
use function array_values;
use function is_array;
final class ExportRowsController extends AbstractController
@ -45,9 +46,7 @@ final class ExportRowsController extends AbstractController
// for the /table/change script.
$GLOBALS['where_clause'] = [];
if (isset($_POST['rows_to_delete']) && is_array($_POST['rows_to_delete'])) {
foreach ($_POST['rows_to_delete'] as $eachWhereClause) {
$GLOBALS['where_clause'][] = $eachWhereClause;
}
$GLOBALS['where_clause'] = array_values($_POST['rows_to_delete']);
}
$GLOBALS['active_page'] = Url::getFromRoute('/table/export');