diff --git a/ChangeLog b/ChangeLog index 537d21e15..00d7bf716 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ $Source$ 2002-10-21 Marc Delisle * lang/spanish: removed control M * tbl_relation.php3, bug 619100, relation and non-primary key + * libraries/display_tbl.lib.ph3, bug 619097, order by sum(var) 2002-10-19 Alexander M. Turek * translators.html, spanish-*.inc.php3: Updates, thanks again to diff --git a/libraries/display_tbl.lib.php3 b/libraries/display_tbl.lib.php3 index c4bf8f3c7..15e76f7b3 100644 --- a/libraries/display_tbl.lib.php3 +++ b/libraries/display_tbl.lib.php3 @@ -575,7 +575,12 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) { if (empty($sql_order)) { $is_in_sort = FALSE; } else { - $is_in_sort = eregi('[[:space:]](`?)' . str_replace('\\', '\\\\', $fields_meta[$i]->name) . '(`?)[ ,$]', $sql_order); + //$is_in_sort = eregi('[[:space:]](`?)' . str_replace('\\', '\\\\', $fields_meta[$i]->name) . '(`?)[ ,$]', $sql_order); + $pattern = str_replace('\\', '\\\\', $fields_meta[$i]->name); + $pattern = str_replace('(','\(', $pattern); + $pattern = str_replace(')','\)', $pattern); + $is_in_sort = eregi('[[:space:]](`?)' . $pattern . '(`?)[ ,$]', $sql_order); + } // 2.1.3 Checks if the table name is required (it's the case // for a query with a "JOIN" statement and if the column