From 00ca8581815e412ab952181a29984ca96cb034d6 Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Sun, 22 Apr 2012 06:53:54 -0400 Subject: [PATCH] Patch #3500882 Fixing checkbox behaviour while editing identical rows --- libraries/display_tbl.lib.php | 4 ++-- libraries/mult_submits.inc.php | 11 +++++++++-- tbl_row_action.php | 4 ++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 09010a3db7..39ceb599f6 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -2915,9 +2915,9 @@ function PMA_generateCheckboxForMulti($del_url, $is_display, $row_no, $where_cla $ret .= 'class="' . $class . '"'; } $ret .= ' class="center">' - . '' + . ' value="' . $where_clause_html . '" ' . (isset($GLOBALS['checkall']) ? 'checked="checked"' : '') . ' />' . '' . ' '; } diff --git a/libraries/mult_submits.inc.php b/libraries/mult_submits.inc.php index 5f9b7334b4..7f81b3e273 100644 --- a/libraries/mult_submits.inc.php +++ b/libraries/mult_submits.inc.php @@ -167,7 +167,8 @@ if (!empty($submit_mult) && !empty($what)) { foreach ($selected AS $idx => $sval) { switch ($what) { case 'row_delete': - $full_query .= htmlspecialchars($sval) + $full_query .= 'DELETE FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table) + . ' WHERE ' . urldecode($sval) . ' LIMIT 1' . ';
'; break; case 'drop_db': @@ -250,7 +251,13 @@ if (!empty($submit_mult) && !empty($what)) { $_url_params['table']= $table; } foreach ($selected as $idx => $sval) { - $_url_params['selected'][] = $sval; + if ($what == 'row_delete'){ + $_url_params['selected'][] = 'DELETE FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table) + . ' WHERE ' . urldecode($sval) . ' LIMIT 1;'; + } + else { + $_url_params['selected'][] = $sval; + } } if ($what == 'drop_tbl' && !empty($views)) { foreach ($views as $current) { diff --git a/tbl_row_action.php b/tbl_row_action.php index d8d3a97ea1..bd9309bb10 100644 --- a/tbl_row_action.php +++ b/tbl_row_action.php @@ -69,7 +69,7 @@ if (!empty($submit_mult)) { // indicating WHERE clause. Then we build the array which is used // for the tbl_change.php script. $where_clause = array(); - foreach ($_REQUEST['rows_to_delete'] as $i_where_clause => $del_query) { + foreach ($_REQUEST['rows_to_delete'] as $i => $i_where_clause) { $where_clause[] = urldecode($i_where_clause); } @@ -86,7 +86,7 @@ if (!empty($submit_mult)) { // indicating WHERE clause. Then we build the array which is used // for the tbl_change.php script. $where_clause = array(); - foreach ($_REQUEST['rows_to_delete'] as $i_where_clause => $del_query) { + foreach ($_REQUEST['rows_to_delete'] as $i => $i_where_clause) { $where_clause[] = urldecode($i_where_clause); }