• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision4683c16c722bc30e36efeff0d9c92d17dba079dd (tree)
Zeit2007-09-30 22:38:50
Autorhenoheno <henoheno>
Commiterhenoheno

Log Message

Simplify: Creating $this->form->fields only just you need

Ändern Zusammenfassung

Diff

--- a/plugin/tracker.inc.php
+++ b/plugin/tracker.inc.php
@@ -1,6 +1,6 @@
11 <?php
22 // 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 $
44 // Copyright (C) 2003-2005, 2007 PukiWiki Developers Team
55 // License: GPL v2 or (at your option) any later version
66 //
@@ -961,7 +961,6 @@ class Tracker_list
961961 $order_commands = trim($order_commands);
962962 if ($order_commands == '') return array();
963963
964- $fields = $this->form->fields;
965964 $orders = array();
966965
967966 $i = 0;
@@ -973,11 +972,6 @@ class Tracker_list
973972 $fieldname = isset($arg[0]) ? trim($arg[0]) : '';
974973 $order = isset($arg[1]) ? trim($arg[1]) : '';
975974
976- if (! isset($fields[$fieldname])) {
977- $this->error = 'No such field: ' . $fieldname;
978- return FALSE;
979- }
980-
981975 $_order = $this->_sortkey_string2define($order);
982976 if ($_order === FALSE) {
983977 $this->error = 'Invalid sort key: ' . $order;
@@ -1040,6 +1034,13 @@ class Tracker_list
10401034 $fields = $this->form->fields;
10411035 $orders = $this->orders;
10421036
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+
10431044 $params = array(); // Arguments for array_multisort()
10441045
10451046 foreach ($orders as $fieldname => $order) {