Modified: pear/packages/Bugtracker/trunk/README =================================================================== --- pear/packages/Bugtracker/trunk/README 2009-08-13 13:49:08 UTC (rev 287231) +++ pear/packages/Bugtracker/trunk/README 2009-08-13 13:49:33 UTC (rev 287232) @@ -19,10 +19,9 @@ - ./include/prepend.inc Required PEAR packages: - # pear install MDB2 DB_DataObject Text_CAPTCHA_Numeral Text_Diff Tree-beta Net_URL2-beta HTTP HTTP_Upload + # pear install MDB2 DB_DataObject Text_CAPTCHA_Numeral Text_Diff Tree-beta HTTP HTTP_Upload - MDB2 - DB_DataObject - - Net_URL2 - Text_CAPTCHA_Numeral - Text_Diff - Tree Modified: pear/packages/Bugtracker/trunk/include/format-html.php =================================================================== --- pear/packages/Bugtracker/trunk/include/format-html.php 2009-08-13 13:49:08 UTC (rev 287231) +++ pear/packages/Bugtracker/trunk/include/format-html.php 2009-08-13 13:49:33 UTC (rev 287232) @@ -214,35 +214,13 @@ } /** - * Returns an absolute URL using Net_URL - * - * @param string $url All/part of a url - * @return string Full url - */ -function getURL($url) -{ - include_once 'Net/URL2.php'; - $obj = new Net_URL2($url); - return $obj->getURL(); -} - -/** * Redirects to the given full or partial URL. - * will turn the given url into an absolute url - * using the above getURL() function. This function - * does not return. * * @param string $url Full/partial url to redirect to - * @param bool $keepProtocol Whether to keep the current protocol or to force HTTP */ -function localRedirect($url, $keepProtocol = true) +function redirect($url) { - $url = getURL($url, $keepProtocol); - if ($keepProtocol == false) { - $url = preg_replace("/^https/", "http", $url); - } - header('Location: ' . $url); - exit; + header("Location: {$url}"); } /** Modified: pear/packages/Bugtracker/trunk/site/bug.php =================================================================== --- pear/packages/Bugtracker/trunk/site/bug.php 2009-08-13 13:49:08 UTC (rev 287231) +++ pear/packages/Bugtracker/trunk/site/bug.php 2009-08-13 13:49:33 UTC (rev 287232) @@ -7,6 +7,7 @@ // Start session session_start(); +// Handle preview if ($_REQUEST['id'] == 'preview') { $bug_id = 'PREVIEW'; $bug = $_SESSION['bug_preview']; @@ -16,19 +17,22 @@ $bug['assign'] = ''; if (!$bug) { - header('Location: index.php'); + redirect('index.php'); exit; } } else { // Bailout early if no/invalid bug id is passed if (empty($_REQUEST['id']) || !((int) $_REQUEST['id'])) { - header('Location: index.php'); + redirect('index.php'); exit; } else { $bug_id = (int) $_REQUEST['id']; } } +// Init common variables +$errors = array(); + // Obtain common includes require_once '../include/prepend.inc'; @@ -48,7 +52,8 @@ $hash = isset($_GET['t']) ? $_GET['t'] : false; if (!$hash) { - localRedirect("bug.php?id={$bug_id}"); + redirect("bug.php?id={$bug_id}"); + exit; } unsubscribe($bug_id, $hash); $_GET['thanks'] = 9; @@ -62,10 +67,9 @@ * 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'; + $errors[] = 'Incorrect Captcha'; } } @@ -76,7 +80,7 @@ $email = isset($_POST['in']['commentemail']) ? $_POST['in']['commentemail'] : ''; } if ($email == '' || !is_valid_email($email)) { - $errors = 'You must provide a valid email address.'; + $errors[] = 'You must provide a valid email address.'; } else { // Unsubscribe if (isset($_POST['unsubscribe_to_bug'])) { @@ -89,7 +93,8 @@ $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}"); + redirect("bug.php?id={$bug_id}&thanks={$thanks}"); + exit; } } // If we get here, display errors @@ -108,7 +113,8 @@ delete_comment($bug_id, $delete_comment); $addon = '&thanks=1'; } - localRedirect("bug.php?id=$bug_id&edit=1$addon"); + redirect("bug.php?id=$bug_id&edit=1$addon"); + exit; } // captcha is not necessary if the user is logged in @@ -122,7 +128,7 @@ $trytoforce = isset($_POST['trytoforce']) ? (int) $_POST['trytoforce'] : 0; // fetch info about the bug into $bug -if (!$bug) { +if (!isset($bug)) { $bug = bugs_get_bug($bug_id, true); } @@ -143,7 +149,6 @@ } // Handle any updates, displaying errors if there were any -$errors = array(); $previous = $current = array(); /* Fetch RESOLVE_REASONS array */ @@ -285,7 +290,6 @@ // 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'])) { @@ -300,7 +304,7 @@ ) { $errors[] = "You must provide a comment when marking a bug 'Bogus'"; } elseif (($_POST['in']['status'] == 'To be documented' && $bug['status'] != $_POST['in']['status']) || - ($_POST['in']['resolve'] && $RESOLVE_REASONS[$_POST['in']['resolve']]['status'] == 'To be documented') + (isset($_POST['in']['resolve']) && $RESOLVE_REASONS[$_POST['in']['resolve']]['status'] == 'To be documented') ) { /* Require explanation */ if (strlen(trim($ncomment)) == 0) { @@ -437,10 +441,8 @@ 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"); + mail_bug_updates($bug, $_POST['in'], $from, $ncomment, $edit, $bug_id, $previous, $current); + redirect("bug.php?id=$bug_id&thanks=$edit"); exit; } } @@ -690,34 +692,24 @@ Welcome back, ! (Not ? Log out.) - +
- - - - Welcome! If you don't have a SVN account, you can't do anything here.
- You can add a comment by following this link - or if you reported this bug, you can edit this bug over here. - -
- - - - - /> -
- - + Welcome! If you don't have a SVN account, you can't do anything here.
+ You can add a comment by following this link + or if you reported this bug, you can edit this bug over here. +
+ + + + + /> +
- - - +?> Modified: pear/packages/Bugtracker/trunk/site/index.php =================================================================== --- pear/packages/Bugtracker/trunk/site/index.php 2009-08-13 13:49:08 UTC (rev 287231) +++ pear/packages/Bugtracker/trunk/site/index.php 2009-08-13 13:49:33 UTC (rev 287232) @@ -9,7 +9,8 @@ /* If 'id' is passed redirect to the bug page */ $id = !empty($_GET['id']) ? (int) $_GET['id'] : 0; if ($id) { - localRedirect("bug.php?id={$id}"); + redirect("bug.php?id={$id}"); + exit; } response_header('Bugs'); Modified: pear/packages/Bugtracker/trunk/site/patch-add.php =================================================================== --- pear/packages/Bugtracker/trunk/site/patch-add.php 2009-08-13 13:49:08 UTC (rev 287231) +++ pear/packages/Bugtracker/trunk/site/patch-add.php 2009-08-13 13:49:33 UTC (rev 287232) @@ -99,7 +99,7 @@ exit; } - localRedirect('patch-display.php?bug=' . $bug_id . '&patch=' . urlencode($_POST['name']) . '&revision=' . $e); + redirect("patch-display.php?bug={$bug_id}&patch=" . urlencode($_POST['name']) . "&revision={$e}"); exit; } catch (Exception $e) { if (!is_string($_POST['name'])) { Modified: pear/packages/Bugtracker/trunk/site/report.php =================================================================== --- pear/packages/Bugtracker/trunk/site/report.php 2009-08-13 13:49:08 UTC (rev 287231) +++ pear/packages/Bugtracker/trunk/site/report.php 2009-08-13 13:49:33 UTC (rev 287232) @@ -163,7 +163,7 @@ $_POST['in']['status'] = 'Open'; $_SESSION['bug_preview'] = $_POST['in']; $_SESSION['captcha'] = $_POST['captcha']; - header("Location: bug.php?id=preview"); + redirect('bug.php?id=preview'); exit; } @@ -287,9 +287,11 @@ if ($redirectToPatchAdd) { $patchname = urlencode($_POST['in']['patchname']); $patchemail= urlencode($_POST['in']['email']); - localRedirect("patch-add.php?bug_id={$cid}&patchname={$patchname}&email={$patchemail}"); + redirect("patch-add.php?bug_id={$cid}&patchname={$patchname}&email={$patchemail}"); + exit; } - localRedirect("bug.php?id={$cid}&thanks=4"); + redirect("bug.php?id={$cid}&thanks=4"); + exit; } } else { // had errors... @@ -323,8 +325,7 @@ 'passwd' => '', ); response_header('Report - New'); - - ?> +?>

Before you report a bug, make sure to search for similar bugs using the "Bug List" link.