Modified: pear/packages/Bugtracker/trunk/site/bug.php
===================================================================
--- pear/packages/Bugtracker/trunk/site/bug.php 2009-08-13 11:04:22 UTC (rev 287209)
+++ pear/packages/Bugtracker/trunk/site/bug.php 2009-08-13 11:09:00 UTC (rev 287210)
@@ -1,30 +1,30 @@
0) {
- if ($_POST['captcha'] != $_SESSION['answer']) {
- $errors = 'Incorrect Captcha';
- }
- }
+ /**
+ * Check if session answer is set, then compare
+ * it with the post captcha value. If it's not
+ * the same, then it's an incorrect password.
+ */
+ $errors = '';
+ if (isset($_SESSION['answer']) && strlen(trim($_SESSION['answer'])) > 0) {
+ if ($_POST['captcha'] != $_SESSION['answer']) {
+ $errors = 'Incorrect Captcha';
+ }
+ }
- if (empty($errors)) {
- if ($logged_in && $auth_user->registered && !empty($auth_user->email)) {
- $email = $auth_user->email;
- } else {
- $email = isset($_POST['in']['commentemail']) ? $_POST['in']['commentemail'] : '';
- }
- if ($email == '' || !is_valid_email($email)) {
- $errors = 'You must provide a valid email address.';
- } else {
- // Unsubscribe
- if (isset($_POST['unsubscribe_to_bug'])) {
- /* Generate the hash */
- unsubscribe_hash($bug_id, $email);
- $thanks = 8;
- }
- else // Subscribe
- {
- $dbh->prepare('REPLACE INTO bugdb_subscribe SET bug_id = ?, email = ?')->execute(array($bug_id, $email));
- $thanks = 7;
- }
- localRedirect("bug.php?id={$bug_id}&thanks={$thanks}");
- }
- }
- // If we get here, display errors
- response_header('Error in subscription');
- display_bug_error($errors);
- response_footer();
- exit;
+ if (empty($errors)) {
+ if ($logged_in && $auth_user->registered && !empty($auth_user->email)) {
+ $email = $auth_user->email;
+ } else {
+ $email = isset($_POST['in']['commentemail']) ? $_POST['in']['commentemail'] : '';
+ }
+ if ($email == '' || !is_valid_email($email)) {
+ $errors = 'You must provide a valid email address.';
+ } else {
+ // Unsubscribe
+ if (isset($_POST['unsubscribe_to_bug'])) {
+ /* Generate the hash */
+ unsubscribe_hash($bug_id, $email);
+ $thanks = 8;
+ }
+ else // Subscribe
+ {
+ $dbh->prepare('REPLACE INTO bugdb_subscribe SET bug_id = ?, email = ?')->execute(array($bug_id, $email));
+ $thanks = 7;
+ }
+ localRedirect("bug.php?id={$bug_id}&thanks={$thanks}");
+ }
+ }
+ // If we get here, display errors
+ response_header('Error in subscription');
+ display_bug_error($errors);
+ response_footer();
+ exit;
}
// Delete comment
if ($edit == 1 && $is_trusted_developer && isset($_GET['delete_comment'])) {
- $delete_comment = (int) $_GET['delete_comment'];
- $addon = '';
+ $delete_comment = (int) $_GET['delete_comment'];
+ $addon = '';
- if ($delete_comment) {
- delete_comment($bug_id, $delete_comment);
- $addon = '&thanks=1';
- }
- localRedirect("bug.php?id=$bug_id&edit=1$addon");
+ if ($delete_comment) {
+ delete_comment($bug_id, $delete_comment);
+ $addon = '&thanks=1';
+ }
+ localRedirect("bug.php?id=$bug_id&edit=1$addon");
}
// captcha is not necessary if the user is logged in
if ($logged_in) {
- unset($_SESSION['answer']);
+ unset($_SESSION['answer']);
} else {
- /**
- * Numeral Captcha Class
- */
- require_once 'Text/CAPTCHA/Numeral.php';
+ require_once 'Text/CAPTCHA/Numeral.php';
+ $numeralCaptcha = new Text_CAPTCHA_Numeral();
- /**
- * Instantiate the numeral captcha object.
- */
- $numeralCaptcha = new Text_CAPTCHA_Numeral();
+ $captcha = $numeralCaptcha->getOperation();
+ $_SESSION['answer'] = $numeralCaptcha->getAnswer();
}
$trytoforce = isset($_POST['trytoforce']) ? (int) $_POST['trytoforce'] : 0;
@@ -129,18 +125,18 @@
// DB error
if (is_object($bug)) {
- response_header('DB error');
- display_bug_error($bug);
- response_footer();
- exit;
+ response_header('DB error');
+ display_bug_error($bug);
+ response_footer();
+ exit;
}
// Bug not found with passed id
if (!$bug) {
- response_header('No Such Bug');
- display_bug_error("No such bug #{$bug_id}");
- response_footer();
- exit;
+ response_header('No Such Bug');
+ display_bug_error("No such bug #{$bug_id}");
+ response_footer();
+ exit;
}
// handle any updates, displaying errors if there were any
@@ -156,156 +152,156 @@
Bug_DataObject::init();
if (isset($_POST['ncomment']) && !isset($_POST['preview']) && $edit == 3) {
- // Submission of additional comment by others
+ // Submission of additional comment by others
- /**
- * Check if session answer is set, then compare
- * it with the post captcha value. If it's not
- * the same, then it's an incorrect password.
- */
- if (isset($_SESSION['answer']) && strlen(trim($_SESSION['answer'])) > 0) {
- if ($_POST['captcha'] != $_SESSION['answer']) {
- $errors[] = 'Incorrect Captcha';
- }
- }
+ /**
+ * Check if session answer is set, then compare
+ * it with the post captcha value. If it's not
+ * the same, then it's an incorrect password.
+ */
+ if (isset($_SESSION['answer']) && strlen(trim($_SESSION['answer'])) > 0) {
+ if ($_POST['captcha'] != $_SESSION['answer']) {
+ $errors[] = 'Incorrect Captcha';
+ }
+ }
- // Defaults to '' if not logged in
- $_POST['in']['handle'] = $auth_user->handle;
+ // Defaults to '' if not logged in
+ $_POST['in']['handle'] = $auth_user->handle;
- $ncomment = trim($_POST['ncomment']);
- if (!$ncomment) {
- $errors[] = 'You must provide a comment.';
- }
+ $ncomment = trim($_POST['ncomment']);
+ if (!$ncomment) {
+ $errors[] = 'You must provide a comment.';
+ }
- if (!$errors) {
- do {
- if (!$logged_in) {
+ if (!$errors) {
+ do {
+ if (!$logged_in) {
- if (!is_valid_email($_POST['in']['commentemail'])) {
- $errors[] = 'You must provide a valid email address.';
- response_header('Add Comment - Problems');
- break; // skip bug comment addition
- }
+ if (!is_valid_email($_POST['in']['commentemail'])) {
+ $errors[] = 'You must provide a valid email address.';
+ response_header('Add Comment - Problems');
+ break; // skip bug comment addition
+ }
- $_POST['in']['name'] = '';
- } else {
- $_POST['in']['commentemail'] = $auth_user->email;
- $_POST['in']['handle'] = $auth_user->handle;
- $_POST['in']['name'] = $auth_user->name;
- }
+ $_POST['in']['name'] = '';
+ } else {
+ $_POST['in']['commentemail'] = $auth_user->email;
+ $_POST['in']['handle'] = $auth_user->handle;
+ $_POST['in']['name'] = $auth_user->name;
+ }
// FIXME: MDB2 changes '' into null? Need to pass handle like this because of it..
- $handle = $dbh->escape($_POST['in']['handle']);
- $query = "INSERT INTO bugdb_comments (bug, email, handle, ts, comment, reporter_name)
- VALUES (?, ?, '{$handle}', NOW(), ?, ?)";
- $res = $dbh->prepare($query)->execute(array(
- $bug_id,
- $_POST['in']['commentemail'],
- $ncomment,
- $_POST['in']['name'],
- ));
- } while (false);
+ $handle = $dbh->escape($_POST['in']['handle']);
+ $query = "INSERT INTO bugdb_comments (bug, email, handle, ts, comment, reporter_name)
+ VALUES (?, ?, '{$handle}', NOW(), ?, ?)";
+ $res = $dbh->prepare($query)->execute(array(
+ $bug_id,
+ $_POST['in']['commentemail'],
+ $ncomment,
+ $_POST['in']['name'],
+ ));
+ } while (false);
- if (isset($auth_user) && $auth_user) {
- $from = $auth_user->email;
- } else {
- $from = '';
- }
- } else {
- $from = '';
- }
+ if (isset($auth_user) && $auth_user) {
+ $from = $auth_user->email;
+ } else {
+ $from = '';
+ }
+ } else {
+ $from = '';
+ }
} elseif (isset($_POST['ncomment']) && isset($_POST['preview']) && $edit == 3) {
- $ncomment = trim($_POST['ncomment']);
- $from = spam_protect($_POST['in']['commentemail']);
-
+ $ncomment = trim($_POST['ncomment']);
+ $from = spam_protect($_POST['in']['commentemail']);
+
} elseif (isset($_POST['in']) && !isset($_POST['preview']) && $edit == 2) {
- // Edits submitted by original reporter for old bugs
+ // Edits submitted by original reporter for old bugs
- if (!verify_bug_passwd($bug_id, $pw)) {
- $errors[] = 'The password you supplied was incorrect.';
- }
+ if (!verify_bug_passwd($bug_id, $pw)) {
+ $errors[] = 'The password you supplied was incorrect.';
+ }
- $ncomment = trim($_POST['ncomment']);
- if (!$ncomment) {
- $errors[] = 'You must provide a comment.';
- }
+ $ncomment = trim($_POST['ncomment']);
+ if (!$ncomment) {
+ $errors[] = 'You must provide a comment.';
+ }
- /* check that they aren't being bad and setting a status they
- aren't allowed to (oh, the horrors.) */
- if ($_POST['in']['status'] != $bug['status'] && $state_types[$_POST['in']['status']] != 2) {
- $errors[] = 'You aren\'t allowed to change a bug to that state.';
- }
+ /* check that they aren't being bad and setting a status they
+ aren't allowed to (oh, the horrors.) */
+ if ($_POST['in']['status'] != $bug['status'] && $state_types[$_POST['in']['status']] != 2) {
+ $errors[] = 'You aren\'t allowed to change a bug to that state.';
+ }
- /* check that they aren't changing the mail to a php.net address
- (gosh, somebody might be fooled!) */
- if (preg_match('/^(.+)@php\.net/i', $_POST['in']['email'], $m)) {
- if ($user != $m[1] || $logged_in != 'developer') {
- $errors[] = 'You have to be logged in as a developer to use your php.net email address.';
- $errors[] = 'Tip: log in via another browser window then resubmit the form in this window.';
- }
- }
+ /* check that they aren't changing the mail to a php.net address
+ (gosh, somebody might be fooled!) */
+ if (preg_match('/^(.+)@php\.net/i', $_POST['in']['email'], $m)) {
+ if ($user != $m[1] || $logged_in != 'developer') {
+ $errors[] = 'You have to be logged in as a developer to use your php.net email address.';
+ $errors[] = 'Tip: log in via another browser window then resubmit the form in this window.';
+ }
+ }
- if (!empty($_POST['in']['email']) &&
- $bug['email'] != $_POST['in']['email']
- ) {
- $from = $_POST['in']['email'];
- } else {
- $from = $bug['email'];
- }
+ if (!empty($_POST['in']['email']) &&
+ $bug['email'] != $_POST['in']['email']
+ ) {
+ $from = $_POST['in']['email'];
+ } else {
+ $from = $bug['email'];
+ }
- if (!empty($_POST['in']['package_name']) &&
- $bug['package_name'] != $_POST['in']['package_name']
- ) {
- // reset package version if we change package name
- $_POST['in']['package_version'] = '';
- }
+ if (!empty($_POST['in']['package_name']) &&
+ $bug['package_name'] != $_POST['in']['package_name']
+ ) {
+ // reset package version if we change package name
+ $_POST['in']['package_version'] = '';
+ }
- if (!$errors && !($errors = incoming_details_are_valid($_POST['in'], false))) {
- $dbh->prepare("
- UPDATE bugdb
- SET
- sdesc = ?,
- status = ?,
- package_name = ?,
- bug_type = ?,
- package_version = ?,
- php_version = ?,
- php_os = ?,
- email = ?,
- ts2 = NOW()
- WHERE id={$bug_id}
- ")->execute(array(
- $_POST['in']['sdesc'],
- $_POST['in']['status'],
- $_POST['in']['package_name'],
- $_POST['in']['bug_type'],
- $_POST['in']['package_version'],
- $_POST['in']['php_version'],
- $_POST['in']['php_os'],
- $from,
- ));
+ if (!$errors && !($errors = incoming_details_are_valid($_POST['in'], false))) {
+ $dbh->prepare("
+ UPDATE bugdb
+ SET
+ sdesc = ?,
+ status = ?,
+ package_name = ?,
+ bug_type = ?,
+ package_version = ?,
+ php_version = ?,
+ php_os = ?,
+ email = ?,
+ ts2 = NOW()
+ WHERE id={$bug_id}
+ ")->execute(array(
+ $_POST['in']['sdesc'],
+ $_POST['in']['status'],
+ $_POST['in']['package_name'],
+ $_POST['in']['bug_type'],
+ $_POST['in']['package_version'],
+ $_POST['in']['php_version'],
+ $_POST['in']['php_os'],
+ $from,
+ ));
- if (!empty($ncomment)) {
- $query = "INSERT INTO bugdb_comments (bug, email, ts, comment)
- VALUES ({$bug_id}, ?, NOW(), ?)";
- $dbh->prepare($query)->execute(array($from, $ncomment));
- }
- }
+ if (!empty($ncomment)) {
+ $query = "INSERT INTO bugdb_comments (bug, email, ts, comment)
+ VALUES ({$bug_id}, ?, NOW(), ?)";
+ $dbh->prepare($query)->execute(array($from, $ncomment));
+ }
+ }
} elseif (isset($_POST['in']) && isset($_POST['preview']) && $edit == 2) {
- $ncomment = trim($_POST['ncomment']);
- $from = $_POST['in']['commentemail'];
+ $ncomment = trim($_POST['ncomment']);
+ $from = $_POST['in']['commentemail'];
} elseif (isset($_POST['in']) && is_array($_POST['in']) && !isset($_POST['preview']) && $edit == 1) {
- // Edits submitted by developer
- if ($logged_in != 'developer') {
- $errors[] = 'You have to login first in order to edit the bug report.';
- $errors[] = 'Tip: log in via another browser window then resubmit the form in this window.';
- }
- $comment_name = $auth_user->name;
- if (empty($_POST['ncomment'])) {
- $ncomment = '';
- } else {
- $ncomment = trim($_POST['ncomment']);
- }
+ // Edits submitted by developer
+ if ($logged_in != 'developer') {
+ $errors[] = 'You have to login first in order to edit the bug report.';
+ $errors[] = 'Tip: log in via another browser window then resubmit the form in this window.';
+ }
+ $comment_name = $auth_user->name;
+ if (empty($_POST['ncomment'])) {
+ $ncomment = '';
+ } else {
+ $ncomment = trim($_POST['ncomment']);
+ }
/* Require comment for open bugs only */
if ($_POST['in']['status'] == 'Bogus' && !in_array($bug['status'], array ('Bogus', 'Closed', 'Duplicate', 'No feedback', 'Wont fix')) &&
@@ -328,197 +324,197 @@
}
$_POST['in']['status'] = 'To be documented';
} elseif (!empty($_POST['in']['resolve'])) {
- if (!$trytoforce && isset($RESOLVE_REASONS[$_POST['in']['resolve']]) &&
- $RESOLVE_REASONS[$_POST['in']['resolve']]['status'] == $bug['status'])
- {
- $errors[] = 'The bug is already marked "'.$bug['status'].'". (Submit again to ignore this.)';
- } elseif (!$errors) {
- if ($_POST['in']['status'] == $bug['status']) {
- $_POST['in']['status'] = $RESOLVE_REASONS[$_POST['in']['resolve']]['status'];
+ if (!$trytoforce && isset($RESOLVE_REASONS[$_POST['in']['resolve']]) &&
+ $RESOLVE_REASONS[$_POST['in']['resolve']]['status'] == $bug['status'])
+ {
+ $errors[] = 'The bug is already marked "'.$bug['status'].'". (Submit again to ignore this.)';
+ } elseif (!$errors) {
+ if ($_POST['in']['status'] == $bug['status']) {
+ $_POST['in']['status'] = $RESOLVE_REASONS[$_POST['in']['resolve']]['status'];
}
- if ($_POST['in']['status'] == 'Closed' && $bug['status'] == 'To be documented') {
- $reason = $FIX_VARIATIONS['fixed']['Documentation problem'];
+ if ($_POST['in']['status'] == 'Closed' && $bug['status'] == 'To be documented') {
+ $reason = $FIX_VARIATIONS['fixed']['Documentation problem'];
} elseif (isset($FIX_VARIATIONS) && isset($FIX_VARIATIONS[$_POST['in']['resolve']][$bug['package_name']])) {
- $reason = $FIX_VARIATIONS[$_POST['in']['resolve']][$bug['package_name']];
- } else {
- $reason = isset($RESOLVE_REASONS[$_POST['in']['resolve']]) ? $RESOLVE_REASONS[$_POST['in']['resolve']]['message'] : '';
- }
+ $reason = $FIX_VARIATIONS[$_POST['in']['resolve']][$bug['package_name']];
+ } else {
+ $reason = isset($RESOLVE_REASONS[$_POST['in']['resolve']]) ? $RESOLVE_REASONS[$_POST['in']['resolve']]['message'] : '';
+ }
- // do a replacement on @svn@ to the likely location of SVN for this package
- if ($_POST['in']['resolve'] == 'trysvn') {
- switch ($bug['package_name']) {
- case 'Documentation' :
- case 'Web Site' :
- case 'Bug System' :
- case 'PEPr' :
- $errors[] = 'Cannot use "try svn" with ' . $bug['package_name'];
- break;
- case 'PEAR' :
- $reason = str_replace('@svn@', 'pear-core', $reason);
- $ncomment = "$reason\n\n$ncomment";
- break;
- default :
- $reason = str_replace('@svn@', $bug['package_name'], $reason);
- $ncomment = "$reason\n\n$ncomment";
- break;
- }
- } else {
- $ncomment = "$reason\n\n$ncomment";
- }
- }
- }
+ // do a replacement on @svn@ to the likely location of SVN for this package
+ if ($_POST['in']['resolve'] == 'trysvn') {
+ switch ($bug['package_name']) {
+ case 'Documentation' :
+ case 'Web Site' :
+ case 'Bug System' :
+ case 'PEPr' :
+ $errors[] = 'Cannot use "try svn" with ' . $bug['package_name'];
+ break;
+ case 'PEAR' :
+ $reason = str_replace('@svn@', 'pear-core', $reason);
+ $ncomment = "$reason\n\n$ncomment";
+ break;
+ default :
+ $reason = str_replace('@svn@', $bug['package_name'], $reason);
+ $ncomment = "$reason\n\n$ncomment";
+ break;
+ }
+ } else {
+ $ncomment = "$reason\n\n$ncomment";
+ }
+ }
+ }
- $from = $auth_user->email;
+ $from = $auth_user->email;
- if (!$errors && !($errors = incoming_details_are_valid($_POST['in']))) {
- $query = 'UPDATE bugdb SET';
+ if (!$errors && !($errors = incoming_details_are_valid($_POST['in']))) {
+ $query = 'UPDATE bugdb SET';
- // Update email only if it's passed
- if ($bug['email'] != $_POST['in']['email'] && !empty($_POST['in']['email']))
- {
- $query .= " email='{$_POST['in']['email']}',";
- }
+ // Update email only if it's passed
+ if ($bug['email'] != $_POST['in']['email'] && !empty($_POST['in']['email']))
+ {
+ $query .= " email='{$_POST['in']['email']}',";
+ }
- if ($logged_in != 'developer') {
- // don't reset assigned status
- $_POST['in']['assign'] = $bug['assign'];
- }
- if (!empty($_POST['in']['assign']) && $_POST['in']['status'] == 'Open') {
- $status = 'Assigned';
- } elseif (empty($_POST['in']['assign']) && $_POST['in']['status'] == 'Assigned') {
- $status = 'Open';
- } else {
- $status = $_POST['in']['status'];
- }
+ if ($logged_in != 'developer') {
+ // don't reset assigned status
+ $_POST['in']['assign'] = $bug['assign'];
+ }
+ if (!empty($_POST['in']['assign']) && $_POST['in']['status'] == 'Open') {
+ $status = 'Assigned';
+ } elseif (empty($_POST['in']['assign']) && $_POST['in']['status'] == 'Assigned') {
+ $status = 'Open';
+ } else {
+ $status = $_POST['in']['status'];
+ }
- if ($status == 'Closed' && $_POST['in']['assign'] == '') {
- $_POST['in']['assign'] = $auth_user->handle;
- }
+ if ($status == 'Closed' && $_POST['in']['assign'] == '') {
+ $_POST['in']['assign'] = $auth_user->handle;
+ }
- if (!empty($_POST['in']['package_name']) &&
- $bug['package_name'] != $_POST['in']['package_name']) {
- // reset package version if we change package name
- $_POST['in']['package_version'] = '';
- }
+ if (!empty($_POST['in']['package_name']) &&
+ $bug['package_name'] != $_POST['in']['package_name']) {
+ // reset package version if we change package name
+ $_POST['in']['package_version'] = '';
+ }
- $dbh->prepare($query .= "
- sdesc = ?,
- status = ?,
- package_name = ?,
- bug_type = ?,
- assign = ?,
- package_version = ?,
- php_version = ?,
- php_os = ?,
- ts2=NOW() WHERE id = {$bug_id}
- ")->execute(array (
- $_POST['in']['sdesc'],
- $status,
- $_POST['in']['package_name'],
- $_POST['in']['bug_type'],
- $_POST['in']['assign'],
- !empty($_POST['in']['package_version']) ? $_POST['in']['package_version'] : '',
- $_POST['in']['php_version'],
- $_POST['in']['php_os'],
- ));
+ $dbh->prepare($query .= "
+ sdesc = ?,
+ status = ?,
+ package_name = ?,
+ bug_type = ?,
+ assign = ?,
+ package_version = ?,
+ php_version = ?,
+ php_os = ?,
+ ts2=NOW() WHERE id = {$bug_id}
+ ")->execute(array (
+ $_POST['in']['sdesc'],
+ $status,
+ $_POST['in']['package_name'],
+ $_POST['in']['bug_type'],
+ $_POST['in']['assign'],
+ !empty($_POST['in']['package_version']) ? $_POST['in']['package_version'] : '',
+ $_POST['in']['php_version'],
+ $_POST['in']['php_os'],
+ ));
- $changed = bug_diff($bug, $_POST['in']);
- if (!empty($changed)) {
- $log_comment = bug_diff_render_html($changed);
- }
+ $changed = bug_diff($bug, $_POST['in']);
+ if (!empty($changed)) {
+ $log_comment = bug_diff_render_html($changed);
+ }
- if (!empty($log_comment)) {
- $dbh->prepare("
- INSERT INTO bugdb_comments (bug, email, ts, comment, reporter_name, handle, comment_type)
- VALUES (?, ?, NOW(), ?, ?, ?, 'log')
- ")->execute(array ($bug_id, $from, $log_comment, $comment_name, $auth_user->handle));
- }
+ if (!empty($log_comment)) {
+ $dbh->prepare("
+ INSERT INTO bugdb_comments (bug, email, ts, comment, reporter_name, handle, comment_type)
+ VALUES (?, ?, NOW(), ?, ?, ?, 'log')
+ ")->execute(array ($bug_id, $from, $log_comment, $comment_name, $auth_user->handle));
+ }
- if (!empty($ncomment)) {
- $dbh->prepare("
- INSERT INTO bugdb_comments (bug, email, ts, comment, reporter_name, handle, comment_type)
- VALUES (?, ?, NOW(), ?, ?, ?, 'comment')
- ")->execute(array ($bug_id, $from, $ncomment, $comment_name, $auth_user->handle));
- }
- }
+ if (!empty($ncomment)) {
+ $dbh->prepare("
+ INSERT INTO bugdb_comments (bug, email, ts, comment, reporter_name, handle, comment_type)
+ VALUES (?, ?, NOW(), ?, ?, ?, 'comment')
+ ")->execute(array ($bug_id, $from, $ncomment, $comment_name, $auth_user->handle));
+ }
+ }
} elseif (isset($_POST['in']) && isset($_POST['preview']) && $edit == 1) {
- $ncomment = trim($_POST['ncomment']);
- $from = $auth_user->email;
+ $ncomment = trim($_POST['ncomment']);
+ $from = $auth_user->email;
} elseif (isset($_POST['in'])) {
- $errors[] = 'Invalid edit mode.';
- $ncomment = '';
+ $errors[] = 'Invalid edit mode.';
+ $ncomment = '';
} else {
- $ncomment = '';
+ $ncomment = '';
}
if (isset($_POST['in']) && (!isset($_POST['preview']) && $ncomment || $previous != $current)) {
- if (!$errors) {
- if (!isset($buggie)) {
- mail_bug_updates($bug, $_POST['in'], $from, $ncomment, $edit, $bug_id, $previous, $current);
- }
- localRedirect("bug.php?id=$bug_id&thanks=$edit");
- exit;
- }
+ if (!$errors) {
+ if (!isset($buggie)) {
+ mail_bug_updates($bug, $_POST['in'], $from, $ncomment, $edit, $bug_id, $previous, $current);
+ }
+ localRedirect("bug.php?id=$bug_id&thanks=$edit");
+ exit;
+ }
}
switch (txfield('bug_type', $bug, isset($_POST['in']) ? $_POST['in'] : null))
{
- case 'Feature/Change Request':
- $bug_type = 'Request';
- break;
- case 'Documentation Problem':
- $bug_type = 'Doc Bug';
- break;
- default:
- case 'Bug':
- $bug_type = 'Bug';
- break;
+ case 'Feature/Change Request':
+ $bug_type = 'Request';
+ break;
+ case 'Documentation Problem':
+ $bug_type = 'Doc Bug';
+ break;
+ default:
+ case 'Bug':
+ $bug_type = 'Bug';
+ break;
}
response_header(
- "{$bug_type} #{$bug_id} :: " . htmlspecialchars($bug['sdesc']),
- "
-
-
-
- "
+ "{$bug_type} #{$bug_id} :: " . htmlspecialchars($bug['sdesc']),
+ "
+
+
+
+ "
);
// DISPLAY BUG
$thanks = (isset($_GET['thanks'])) ? (int) $_GET['thanks'] : 0;
switch ($thanks)
{
- case 1:
- case 2:
- display_bug_success('The bug was updated successfully.');
- break;
- case 3:
- display_bug_success('Your comment was added to the bug successfully.');
- break;
- case 4:
- $bug_url = "http://{$site_url}{$basedir}/bug.php?id={$bug_id}";
- display_bug_success("
- Thank you for your help!
- If the status of the bug report you submitted changes, you will be notified.
- You may return here and check the status or update your report at any time.
- The URL for your bug report is: {$bug_url}.
- ");
- break;
- case 6:
- display_bug_success('Thanks for voting! Your vote should be reflected in the statistics below.');
- break;
- case 7:
- display_bug_success('Your subscribe request has been processed.');
- break;
- case 8:
- display_bug_success('Your unsubscribe request has been processed, please check your email.');
- break;
- case 9:
- display_bug_success('You have successfully unsubscribed.');
- break;
+ case 1:
+ case 2:
+ display_bug_success('The bug was updated successfully.');
+ break;
+ case 3:
+ display_bug_success('Your comment was added to the bug successfully.');
+ break;
+ case 4:
+ $bug_url = "http://{$site_url}{$basedir}/bug.php?id={$bug_id}";
+ display_bug_success("
+ Thank you for your help!
+ If the status of the bug report you submitted changes, you will be notified.
+ You may return here and check the status or update your report at any time.
+ The URL for your bug report is: {$bug_url}.
+ ");
+ break;
+ case 6:
+ display_bug_success('Thanks for voting! Your vote should be reflected in the statistics below.');
+ break;
+ case 7:
+ display_bug_success('Your subscribe request has been processed.');
+ break;
+ case 8:
+ display_bug_success('Your unsubscribe request has been processed, please check your email.');
+ break;
+ case 9:
+ display_bug_success('You have successfully unsubscribed.');
+ break;
- default:
- break;
+ default:
+ break;
}
display_bug_error($errors);
@@ -537,15 +533,15 @@
|
-
- | Votes: | |
- | Avg. Score: | |
- | Reproduced: | |
-
- | Same Version: | |
- | Same OS: | |
-
-
+
+ | Votes: | |
+ | Avg. Score: | |
+ | Reproduced: | |
+
+ | Same Version: | |
+ | Same OS: | |
+
+
|
@@ -590,47 +586,47 @@
+
@@ -910,7 +905,7 @@
// Display original report
if ($bug['ldesc']) {
- output_note(0, $bug['submitted'], $bug['email'], $bug['ldesc'], 'comment', $bug['bughandle'], $bug['reporter_name']);
+ output_note(0, $bug['submitted'], $bug['email'], $bug['ldesc'], 'comment', $bug['bughandle'], $bug['reporter_name']);
}
// Display patches
@@ -924,8 +919,8 @@
foreach ($p as $name => $revisions)
{
- $obsolete = $patches->getObsoletingPatches($bug_id, $name, $revisions[0][0]);
- $style = !empty($obsolete) ? ' style="background-color: yellow; text-decoration: line-through;" ' : '';
+ $obsolete = $patches->getObsoletingPatches($bug_id, $name, $revisions[0][0]);
+ $style = !empty($obsolete) ? ' style="background-color: yellow; text-decoration: line-through;" ' : '';
// ?>>
(last revision by )
History',
+ echo 'History
',
"
";
echo "\n";
+ foreach ($bug_comments as $row) {
+ output_note($row['id'], $row['added'], $row['email'], $row['comment'], $row['comment_type'], ($row['bughandle'] ? $row['bughandle'] : $row['handle']), $row['comment_name']);
+ }
+ echo "\n";
}
if($bug_id == 'PREVIEW'):
?>
@@ -998,26 +993,26 @@
*/
function output_note($com_id, $ts, $email, $comment, $comment_type, $handle, $comment_name)
{
- global $edit, $bug_id, $dbh, $is_trusted_developer, $logged_in;
+ global $edit, $bug_id, $dbh, $is_trusted_developer, $logged_in;
- $display = ($comment_type == 'comment') ? '' : 'style="display:none;"';
- echo "