Revision | 4683c16c722bc30e36efeff0d9c92d17dba079dd (tree) |
---|---|
Zeit | 2007-09-30 22:38:50 |
Autor | henoheno <henoheno> |
Commiter | henoheno |
Simplify: Creating $this->form->fields only just you need
@@ -1,6 +1,6 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | -// $Id: tracker.inc.php,v 1.94 2007/09/30 13:23:39 henoheno Exp $ | |
3 | +// $Id: tracker.inc.php,v 1.95 2007/09/30 13:38:50 henoheno Exp $ | |
4 | 4 | // Copyright (C) 2003-2005, 2007 PukiWiki Developers Team |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
@@ -961,7 +961,6 @@ class Tracker_list | ||
961 | 961 | $order_commands = trim($order_commands); |
962 | 962 | if ($order_commands == '') return array(); |
963 | 963 | |
964 | - $fields = $this->form->fields; | |
965 | 964 | $orders = array(); |
966 | 965 | |
967 | 966 | $i = 0; |
@@ -973,11 +972,6 @@ class Tracker_list | ||
973 | 972 | $fieldname = isset($arg[0]) ? trim($arg[0]) : ''; |
974 | 973 | $order = isset($arg[1]) ? trim($arg[1]) : ''; |
975 | 974 | |
976 | - if (! isset($fields[$fieldname])) { | |
977 | - $this->error = 'No such field: ' . $fieldname; | |
978 | - return FALSE; | |
979 | - } | |
980 | - | |
981 | 975 | $_order = $this->_sortkey_string2define($order); |
982 | 976 | if ($_order === FALSE) { |
983 | 977 | $this->error = 'Invalid sort key: ' . $order; |
@@ -1040,6 +1034,13 @@ class Tracker_list | ||
1040 | 1034 | $fields = $this->form->fields; |
1041 | 1035 | $orders = $this->orders; |
1042 | 1036 | |
1037 | + foreach (array_keys($orders) as $fieldname) { | |
1038 | + if (! isset($fields[$fieldname])) { | |
1039 | + $this->error = 'No such field: ' . $fieldname; | |
1040 | + return FALSE; | |
1041 | + } | |
1042 | + } | |
1043 | + | |
1043 | 1044 | $params = array(); // Arguments for array_multisort() |
1044 | 1045 | |
1045 | 1046 | foreach ($orders as $fieldname => $order) { |