cvs: pearweb /public_html/bugs bug.php

From: Date: Sat, 29 Mar 2008 23:31:52 +0000
Subject: cvs: pearweb /public_html/bugs bug.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-7421@lists.php.net to get a copy of this message
dufuz Sat Mar 29 23:31:52 2008 UTC Modified files: /pearweb/public_html/bugs bug.php Log: The SITE constant used Killed couple of GLOBALS usages, for example in field() http://cvs.php.net/viewvc.cgi/pearweb/public_html/bugs/bug.php?r1=1.196&r2=1.197&diff_format=u Index: pearweb/public_html/bugs/bug.php diff -u pearweb/public_html/bugs/bug.php:1.196 pearweb/public_html/bugs/bug.php:1.197 --- pearweb/public_html/bugs/bug.php:1.196 Tue Mar 25 02:18:26 2008 +++ pearweb/public_html/bugs/bug.php Sat Mar 29 23:31:52 2008 @@ -15,7 +15,7 @@ * @package Bugs * @copyright Copyright (c) 1997-2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License - * @version $Id: bug.php,v 1.196 2008/03/25 02:18:26 dufuz Exp $ + * @version $Id: bug.php,v 1.197 2008/03/29 23:31:52 dufuz Exp $ */ /* @@ -50,7 +50,7 @@ $unsubcribe = (int)$_GET['unsubscribe']; $hash = isset($_GET['t']) ? $_GET['t'] : false; - $site == 'pear' ? $redirect = 'pecl' : $redirect = 'pear'; + SITE == 'pear' ? $redirect = 'pecl' : $redirect = 'pear'; if (!$hash) { localRedirect('bug.php?id='.$id); @@ -185,8 +185,8 @@ } // Redirect to PECL if it's a PECL bug -if (!empty($bug['package_type']) && $bug['package_type'] != $site) { - $site == 'pear' ? $redirect = 'pecl' : $redirect = 'pear'; +if (!empty($bug['package_type']) && $bug['package_type'] != SITE) { + SITE == 'pear' ? $redirect = 'pecl' : $redirect = 'pear'; localRedirect('http://' . $redirect . '.php.net/bugs/bug.php?id='.$id); exit; } @@ -544,7 +544,7 @@ } response_header("$bug_type #$id :: " . htmlspecialchars($bug['sdesc']), false, ' <link rel="alternate" type="application/rdf+xml" title="RSS feed" href="http://' . - htmlspecialchars($_SERVER['HTTP_HOST']) . '/feeds/bug_' . $id . '.rss" /> + PEAR_CHANNELNAME . '/feeds/bug_' . $id . '.rss" /> '); show_bugs_menu(txfield('package_name')); @@ -565,7 +565,7 @@ . ' notified. You may return here and check on the' . ' status or update your report at any time. The URL' . ' for your bug report is: <a href="/bugs/'. $id . '">' - . 'http://'.$site.'.php.net/bugs/' . $id . '</a>.'); + . 'http://'. PEAR_CHANNELNAME .'/bugs/' . $id . '</a>.'); } elseif ($_GET['thanks'] == 6) { report_success('Thanks for voting! Your vote should be reflected' @@ -708,15 +708,15 @@ <?php -control(0, 'View'); +control(0, 'View', $id, $edit); if ( (!(isset($auth_user) && $auth_user && $auth_user->registered) || !auth_check('pear.dev')) && $edit != 2 ) { - control(3, 'Add Comment'); + control(3, 'Add Comment', $id, $edit); } if (auth_check('pear.bug') || auth_check('pear.dev')) { - control(1, 'Edit'); + control(1, 'Edit', $id, $edit); } ?> @@ -900,8 +900,9 @@ <th>Status:</th> <td <?php echo (($edit != 1) ? 'colspan="3"' : '' ) ?>> <select name="in[status]"> - <?php show_state_options(isset($_POST['in']) && isset($_POST['in']['status']) ? - $_POST['in']['status'] : '', $edit, $bug['status']) ?> + <?php + $status = isset($_POST['in']) && isset($_POST['in']['status']) ? $_POST['in']['status'] : ''; + show_state_options($status, $edit, $bug['status']) ?> </select> <?php @@ -912,8 +913,7 @@ <th>Assign to:</th> <td> <input type="text" size="10" maxlength="16" name="in[assign]" - value="<?php echo field('assign') ?>" /> - + value="<?php echo field('assign', $bug) ?>" /> <?php } ?> @@ -944,13 +944,13 @@ <th>Summary:</th> <td colspan="3"> <input type="text" size="60" maxlength="80" name="in[sdesc]" - value="<?php echo field('sdesc') ?>" /> + value="<?php echo field('sdesc', $bug) ?>" /> </td> </tr> <tr> <th>From:</th> <td colspan="3"> - <?php echo $pbu->spamProtect(field('email')) ?> + <?php echo $pbu->spamProtect(field('email', $bug)) ?> </td> </tr> <tr> @@ -965,17 +965,17 @@ <th>PHP Version:</th> <td> <input type="text" size="20" maxlength="100" name="in[php_version]" - value="<?php echo field('php_version') ?>" /> + value="<?php echo field('php_version', $bug) ?>" /> </td> <th>Package Version:</th> <td> <input type="text" size="20" maxlength="100" name="in[package_version]" - value="<?php echo field('package_version') ?>" /> + value="<?php echo field('package_version', $bug) ?>" /> </td> <th>OS:</th> <td> <input type="text" size="20" maxlength="32" name="in[php_os]" - value="<?php echo field('php_os') ?>" /> + value="<?php echo field('php_os', $bug) ?>" /> </td> </tr> <?php if (auth_check('pear.dev')): ?> @@ -1264,7 +1264,7 @@ echo '<pre class="note">If you submitted this note, check your email.'; echo 'If you do not have a message, <a href="resend-request-email.php?' . 'handle=' . urlencode($handle) . "\">click here to re-send</a>\n", - 'MANUAL CONFIRMATION IS NOT POSSIBLE. Write a message to <a href="mailto:' . PEAR_DEV_LIST . '">' . PEAR_DEV_LIST . '</a>' . "\n", + 'MANUAL CONFIRMATION IS NOT POSSIBLE. Write a message to <a href="mailto:' . PEAR_DEV_EMAIL . '">' . PEAR_DEV_EMAIL . '</a>' . "\n", "to request the confirmation link. All bugs/comments/patches associated with this \nemail address will be deleted within 48 hours if the account request is not confirmed!"; echo "</pre>\n</div>"; @@ -1274,6 +1274,8 @@ if ($handle) { echo '<a href="/user/' . $handle . '">' . $handle . "</a></strong>\n"; } else { + require_once 'bugs/pear-bugs-utils.php'; + $pbu = new PEAR_Bugs_Utils; echo $pbu->spamProtect(htmlspecialchars($email))."</strong>\n"; } } @@ -1321,15 +1323,15 @@ $res =& $dbh->query($query); } -function control($num, $desc) +function control($num, $desc, $id, $edit) { echo '<span id="control_' . $num . '" class="control'; - if ($GLOBALS['edit'] == $num) { + if ($edit == $num) { echo ' active">'; echo $desc; } else { echo '">'; - echo '<a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?id=' . $GLOBALS['id']; + echo '<a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?id=' . $id; echo ($num ? "&amp;edit=$num" : ''); echo '">' . $desc . '</a>'; }

« previous php.pear.core (#7421) next »