From 6a863ea3641ecd95cf7a876fc13d4f84af1d088d Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 16 Jan 2005 14:41:27 +0000 Subject: [PATCH] bug #1103201 --- ChangeLog | 4 ++++ libraries/common.lib.php | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 94c15422b..8d77fb379 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2005-01-16 Marc Delisle + * libraries/common.lib.php: bug #1103201, wrong treatment of MySQL error + #1060 in the logic for error #1062 + 2005-01-15 Alexander M. Turek * server_links.inc.php, server_engines.php, lang/*.inc.php, libraries/storage_engines.php: Detailed storage engines status diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 1b7ec0cd0..8f8cddfc6 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -672,7 +672,10 @@ if ($is_minimum_common == FALSE) { // feature request #1036254: // Add a link by MySQL-Error #1062 - Duplicate entry // 2004-10-20 by mk.keck - if (strstr($tmp_mysql_error,"duplicate")) { + if (substr($error_message, 1, 4) == '1062') { + // TODO: do not assume that the error message is in English + // and do not use mysql_result() + // explode the entry and the column $arr_mysql_val_key = explode('entry \'',$tmp_mysql_error); $arr_mysql_val_key = explode('\' for key',$arr_mysql_val_key[1]);