diff --git a/ChangeLog b/ChangeLog index 6db8baf5c..424f2330d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2005-07-10 Marc Delisle + * libraries/display_tbl.lib.php: bug #1235473 display_tbl.lib.php, + Undefined variable order_img + 2005-07-06 Marc Delisle * db_search.php: bug #1233349, db search in MySQL 5.0.x on fields without a charset diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 1ad805f62..6622de142 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -760,14 +760,12 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $ // FROM `PMA_relation` AS `1` , `PMA_relation` AS `2` if (($is_join - //&& !preg_match('~([^[:space:],]|`[^`]`)[[:space:]]+(as[[:space:]]+)?' . $fields_meta[$i]->name . '~i', $select_stt[1], $parts)) && !preg_match('~([^[:space:],]|`[^`]`)[[:space:]]+(as[[:space:]]+)?' . $fields_meta[$i]->name . '~i', $select_expr, $parts)) || ( isset($analyzed_sql[0]['select_expr'][$i]['expr']) && isset($analyzed_sql[0]['select_expr'][$i]['column']) && $analyzed_sql[0]['select_expr'][$i]['expr'] != $analyzed_sql[0]['select_expr'][$i]['column'] && !empty($fields_meta[$i]->table)) ) { - //$sort_tbl = PMA_backquote($fields_meta[$i]->table) . '.'; $sort_tbl = PMA_backquote($fields_meta[$i]->table) . ' . '; } else { $sort_tbl = ''; @@ -793,6 +791,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $ } else { $sort_order = ' ORDER BY ' . $sort_tbl . PMA_backquote($fields_meta[$i]->name) . ' '; } + // 2.1.4 Do define the sorting url if (!$is_in_sort) { // loic1: patch #455484 ("Smart" order) @@ -810,7 +809,11 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $ else if (preg_match('@[[:space:]]DESC$@i', $sort_expression)) { $sort_order .= ' ASC'; $order_img = ' '. $GLOBALS['strDescending'] . ''; + } else { + $sort_order .= ' DESC'; + $order_img = ' '. $GLOBALS['strAscending'] . ''; } + if (preg_match('@(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|FOR UPDATE|LOCK IN SHARE MODE))@i', $unsorted_sql_query, $regs3)) { $sorted_sql_query = $regs3[1] . $sort_order . $regs3[2]; } else {