better fix for bug #520242 - records get inserted twice
This commit is contained in:
@@ -789,13 +789,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
|
|
||||||
// 1.2.1 Modify link(s)
|
// 1.2.1 Modify link(s)
|
||||||
if ($is_display['edit_lnk'] == 'ur') { // update row case
|
if ($is_display['edit_lnk'] == 'ur') { // update row case
|
||||||
if (!empty($goto)
|
$lnk_goto = 'sql.php3'
|
||||||
&& empty($GLOBALS['QUERY_STRING'])
|
. '?' . str_replace('&', '&', $url_query)
|
||||||
&& (empty($GLOBALS['HTTP_SERVER_VARS']) || empty($GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING']))) {
|
. '&sql_query=' . urlencode($sql_query)
|
||||||
$lnk_goto = $goto;
|
. '&goto=' . (empty($goto) ? 'tbl_properties.php3' : $goto);
|
||||||
} else {
|
|
||||||
$lnk_goto = 'sql.php3';
|
|
||||||
}
|
|
||||||
$edit_url = 'tbl_change.php3'
|
$edit_url = 'tbl_change.php3'
|
||||||
. '?' . $url_query
|
. '?' . $url_query
|
||||||
. '&primary_key=' . $uva_condition
|
. '&primary_key=' . $uva_condition
|
||||||
@@ -810,7 +807,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
. '?' . str_replace('&', '&', $url_query)
|
. '?' . str_replace('&', '&', $url_query)
|
||||||
. '&sql_query=' . urlencode($sql_query)
|
. '&sql_query=' . urlencode($sql_query)
|
||||||
. '&zero_rows=' . urlencode(htmlspecialchars($GLOBALS['strDeleted']))
|
. '&zero_rows=' . urlencode(htmlspecialchars($GLOBALS['strDeleted']))
|
||||||
. '&goto=tbl_properties.php3';
|
. '&goto=' . (empty($goto) ? 'tbl_properties.php3' : $goto);
|
||||||
$del_url = 'sql.php3'
|
$del_url = 'sql.php3'
|
||||||
. '?' . $url_query
|
. '?' . $url_query
|
||||||
. '&sql_query=' . urlencode('DELETE FROM ' . PMA_backquote($table) . ' WHERE') . $uva_condition . urlencode(' LIMIT 1')
|
. '&sql_query=' . urlencode('DELETE FROM ' . PMA_backquote($table) . ' WHERE') . $uva_condition . urlencode(' LIMIT 1')
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
require('./libraries/grab_globals.lib.php3');
|
require('./libraries/grab_globals.lib.php3');
|
||||||
require('./libraries/common.lib.php3');
|
require('./libraries/common.lib.php3');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes some variables
|
* Initializes some variables
|
||||||
*/
|
*/
|
||||||
@@ -22,15 +23,12 @@ if (isset($after_insert) && $after_insert == 'new_insert') {
|
|||||||
. '&db=' . urlencode($db)
|
. '&db=' . urlencode($db)
|
||||||
. '&table=' . urlencode($table)
|
. '&table=' . urlencode($table)
|
||||||
. '&goto=' . urlencode($goto)
|
. '&goto=' . urlencode($goto)
|
||||||
. (empty($primary_key) ? '' : '&primary_key=' . $primary_key)
|
|
||||||
. '&pos=' . $pos
|
. '&pos=' . $pos
|
||||||
. '&session_max_rows=' . $session_max_rows
|
. '&session_max_rows=' . $session_max_rows
|
||||||
. '&disp_direction=' . $disp_direction
|
. '&disp_direction=' . $disp_direction
|
||||||
. '&repeat_cells=' . $repeat_cells
|
. '&repeat_cells=' . $repeat_cells
|
||||||
. (empty($sql_query) ? '' : '&sql_query=' . urlencode($sql_query));
|
. (empty($sql_query) ? '' : '&sql_query=' . urlencode($sql_query));
|
||||||
} else if ($goto == 'sql.php3'
|
} else if ($goto == 'sql.php3') {
|
||||||
|| ($goto == 'tbl_properties.php3'
|
|
||||||
&& eregi('^SELECT[[:space:]]+', $sql_query))) {
|
|
||||||
$goto = 'sql.php3?'
|
$goto = 'sql.php3?'
|
||||||
. 'lang=' . $lang
|
. 'lang=' . $lang
|
||||||
. '&server=' . $server
|
. '&server=' . $server
|
||||||
@@ -46,7 +44,8 @@ if (isset($after_insert) && $after_insert == 'new_insert') {
|
|||||||
if (isset($url_err)) {
|
if (isset($url_err)) {
|
||||||
$url_err = urldecode($url_err);
|
$url_err = urldecode($url_err);
|
||||||
} else {
|
} else {
|
||||||
$url_err = str_replace('&', '&', $goto);
|
$url_err = str_replace('&', '&', $goto)
|
||||||
|
. (empty($primary_key) ? '' : '&primary_key=' . $primary_key);
|
||||||
}
|
}
|
||||||
// Resets tables defined in the configuration file
|
// Resets tables defined in the configuration file
|
||||||
reset($fields);
|
reset($fields);
|
||||||
|
Reference in New Issue
Block a user