From d1c28d904675c675a845de095a0c708c7b8ff7e5 Mon Sep 17 00:00:00 2001 From: henoheno Date: Sun, 3 Apr 2005 12:33:47 +0900 Subject: [PATCH] Added htmlspecialchars() for table header. Do htmlspecialchars() at last. Simplify --- plugin/bugtrack.inc.php | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/plugin/bugtrack.inc.php b/plugin/bugtrack.inc.php index ab3eb35..93723ab 100644 --- a/plugin/bugtrack.inc.php +++ b/plugin/bugtrack.inc.php @@ -1,5 +1,5 @@ ' . "\n"; $bgcolor = htmlspecialchars($_plugin_bugtrack['header_bgcolor']); - $table_html = << - ${_plugin_bugtrack['pagename']} - ${_plugin_bugtrack['state' ]} - ${_plugin_bugtrack['priority']} - ${_plugin_bugtrack['category']} - ${_plugin_bugtrack['name' ]} - ${_plugin_bugtrack['summary' ]} - -EOD; + foreach (array('pagename', 'state', 'priority', 'category', 'name', 'summary') as $item) + $table_html .= ' ' . + htmlspecialchars($_plugin_bugtrack[$item]) . '' . "\n"; + $table_html .= ' ' . "\n"; + for ($i = 0; $i <= $count_list; ++$i) { ksort($table[$i], SORT_NUMERIC); $table_html .= join("\n", $table[$i]); @@ -341,9 +335,9 @@ function plugin_bugtrack_list_pageinfo($page, $no = NULL, $recurse = TRUE) $regex = '/-\s*' . preg_quote($_plugin_bugtrack[$item], '/') . '\s*:(.*)/'; if (preg_match($regex, $body, $matches)) { if ($item == 'name') { - $$item = htmlspecialchars(strip_bracket(trim($matches[1]))); + $$item = strip_bracket(trim($matches[1])); } else { - $$item = htmlspecialchars(trim($matches[1])); + $$item = trim($matches[1]); } } else { $$item = ''; // Data not found -- 2.11.0