cvs: bugtracker /template/generic/bug index.php
| From: | Barry Carlyon | Date: | Tue, 12 Aug 2008 09:48:50 +0000 |
| Subject: | cvs: bugtracker /template/generic/bug index.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-2381@lists.php.net to get a copy of this message | ||
bcarlyon Tue Aug 12 09:48:50 2008 UTC
Modified files:
/bugtracker/template/generic/bug index.php
Log:
Readding the code download, code
http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/index.php?r1=1.27&r2=1.28&diff_format=u
Index: bugtracker/template/generic/bug/index.php
diff -u bugtracker/template/generic/bug/index.php:1.27
bugtracker/template/generic/bug/index.php:1.28
--- bugtracker/template/generic/bug/index.php:1.27 Mon Aug 11 10:51:23 2008
+++ bugtracker/template/generic/bug/index.php Tue Aug 12 09:48:49 2008
@@ -31,6 +31,29 @@
$bug_id = $_REQUEST['bug_id'];
$bug_id = str_replace('/','',$bug_id);
+if (substr($bug_id,0,8) == 'download')
+{
+ //code download!
+ $bug_id = str_replace('download/', '', $bug_id);
+ $bug_id = str_replace('download', '', $bug_id);
+ $query = 'SELECT * FROM bug_comment WHERE bug_id = ' . "'{$bug_id}' AND
comment_type= " . REPRODUCE;
+ $db->get_data($query);
+ if ($db->total_rows)
+ {
+ //lets shunt out a text file
+ header("Cache-Control: no-cache, must-revalidate");
+ header("Content-Type: text/plain");
+ header('Content-Disposition: attachment; filename="bug_reproduce_code_bugid_' .
$bug_id . '.txt"');
+ $file = $db->fetch_row();
+ echo $file['comment'];
+ exit;
+ }
+ else
+ {
+ $content .= '<h2>Invalid Bug Id or no Reproduce Code to download</h2>';
+ }
+}
+
if (is_numeric($bug_id))
{
$template->page_title .= 'Bug #' . $bug_id;