From f31324fac8eea8d392d96c4a01ed77849abef7b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Wed, 22 May 2002 20:36:35 +0000 Subject: [PATCH] Fixed possible errors with special characters in tables names --- libraries/display_tbl.lib.php3 | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/libraries/display_tbl.lib.php3 b/libraries/display_tbl.lib.php3 index a40dd62ec..9e3538c2f 100644 --- a/libraries/display_tbl.lib.php3 +++ b/libraries/display_tbl.lib.php3 @@ -1365,23 +1365,21 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ $result = @mysql_query($local_query); if ($result) { while ($rel = mysql_fetch_row($result)) { - - // check for display field? + // check for display field? if (!empty($cfg['Server']['table_info'])) { - $ti_query = 'SELECT display_field' - . ' FROM ' . $cfg['Server']['table_info'] - . ' WHERE table_name = \'' . $rel[1] . '\''; - $result_ti = @mysql_query($ti_query); + $ti_query = 'SELECT display_field' + . ' FROM ' . PMA_backquote($cfg['Server']['table_info']) + . ' WHERE table_name = \'' . PMA_sqlAddslashes($rel[1]) . '\''; + $result_ti = @mysql_query($ti_query); if ($result_ti) { list($display_field) = mysql_fetch_row($result_ti); - } - else { + } else { $display_field = ''; } - } + } // end if $map[$rel[0]] = array($rel[1], $rel[2], $display_field); - } - } + } // end while + } // end if } // end 2b // 3. ----- Displays the results table -----