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)
|
||||
if ($is_display['edit_lnk'] == 'ur') { // update row case
|
||||
if (!empty($goto)
|
||||
&& empty($GLOBALS['QUERY_STRING'])
|
||||
&& (empty($GLOBALS['HTTP_SERVER_VARS']) || empty($GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING']))) {
|
||||
$lnk_goto = $goto;
|
||||
} else {
|
||||
$lnk_goto = 'sql.php3';
|
||||
}
|
||||
$lnk_goto = 'sql.php3'
|
||||
. '?' . str_replace('&', '&', $url_query)
|
||||
. '&sql_query=' . urlencode($sql_query)
|
||||
. '&goto=' . (empty($goto) ? 'tbl_properties.php3' : $goto);
|
||||
$edit_url = 'tbl_change.php3'
|
||||
. '?' . $url_query
|
||||
. '&primary_key=' . $uva_condition
|
||||
@@ -810,7 +807,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
||||
. '?' . str_replace('&', '&', $url_query)
|
||||
. '&sql_query=' . urlencode($sql_query)
|
||||
. '&zero_rows=' . urlencode(htmlspecialchars($GLOBALS['strDeleted']))
|
||||
. '&goto=tbl_properties.php3';
|
||||
. '&goto=' . (empty($goto) ? 'tbl_properties.php3' : $goto);
|
||||
$del_url = 'sql.php3'
|
||||
. '?' . $url_query
|
||||
. '&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/common.lib.php3');
|
||||
|
||||
|
||||
/**
|
||||
* Initializes some variables
|
||||
*/
|
||||
@@ -22,15 +23,12 @@ if (isset($after_insert) && $after_insert == 'new_insert') {
|
||||
. '&db=' . urlencode($db)
|
||||
. '&table=' . urlencode($table)
|
||||
. '&goto=' . urlencode($goto)
|
||||
. (empty($primary_key) ? '' : '&primary_key=' . $primary_key)
|
||||
. '&pos=' . $pos
|
||||
. '&session_max_rows=' . $session_max_rows
|
||||
. '&disp_direction=' . $disp_direction
|
||||
. '&repeat_cells=' . $repeat_cells
|
||||
. (empty($sql_query) ? '' : '&sql_query=' . urlencode($sql_query));
|
||||
} else if ($goto == 'sql.php3'
|
||||
|| ($goto == 'tbl_properties.php3'
|
||||
&& eregi('^SELECT[[:space:]]+', $sql_query))) {
|
||||
} else if ($goto == 'sql.php3') {
|
||||
$goto = 'sql.php3?'
|
||||
. 'lang=' . $lang
|
||||
. '&server=' . $server
|
||||
@@ -46,7 +44,8 @@ if (isset($after_insert) && $after_insert == 'new_insert') {
|
||||
if (isset($url_err)) {
|
||||
$url_err = urldecode($url_err);
|
||||
} 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
|
||||
reset($fields);
|
||||
|
Reference in New Issue
Block a user