cvs: php-bugs-web / bug-pwd-finder.php bug.php bugstats.php fix.php lbugs.php lstats.php report.php search.php source.php vote.php /include
functions.inc layout.inc /rss bug.php /scripts email-bug-summaries no-feedback

From: Date: Fri, 23 Jan 2004 03:05:31 +0000
Subject: cvs: php-bugs-web / bug-pwd-finder.php bug.php bugstats.php fix.php lbugs.php lstats.php report.php search.php source.php vote.php /include
functions.inc layout.inc /rss bug.php /scripts email-bug-summaries no-feedback
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-23131@lists.php.net to get a copy of this message
didou Thu Jan 22 22:05:31 2004 EDT Modified files: /php-bugs-web bug-pwd-finder.php bug.php bugstats.php fix.php lbugs.php lstats.php report.php search.php source.php vote.php /php-bugs-web/include functions.inc layout.inc /php-bugs-web/rss bug.php /php-bugs-web/scripts email-bug-summaries no-feedback Log: Reverting my patch, we'll see tomorrow what happened. Sorry again :I

http://cvs.php.net/diff.php/php-bugs-web/bug-pwd-finder.php?r1=1.9&r2=1.10&ty=u Index: php-bugs-web/bug-pwd-finder.php diff -u php-bugs-web/bug-pwd-finder.php:1.9 php-bugs-web/bug-pwd-finder.php:1.10 --- php-bugs-web/bug-pwd-finder.php:1.9 Thu Jan 22 21:33:31 2004 +++ php-bugs-web/bug-pwd-finder.php Thu Jan 22 22:05:28 2004 @@ -1,15 +1,14 @@ <?php require_once 'prepend.inc'; -require_once 'config.php'; /* See bugs.php for the table layout of bugdb. */ if ($bug_id) { - mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) + mysql_connect ("localhost","nobody","") or die("Unable to connect to SQL server. Please try again later."); - mysql_select_db(BUG_DB_NAME); + mysql_select_db ("php3"); // Clean up the bug id $bug_id = ereg_replace ("[^0-9]+", "", $bug_id); @@ -64,7 +63,7 @@ <?php if ($msg) { echo "<p><font color=\"#cc0000\">$msg</font></p>"; } ?> -<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"> +<form method="post" action="<?php echo $PHP_SELF;?>"> <p><b>Bug Report ID:</b> #<input type="text" size="20" name="bug_id"> <input type="submit" value="Send"></p> </form> http://cvs.php.net/diff.php/php-bugs-web/bug.php?r1=1.60&r2=1.61&ty=u Index: php-bugs-web/bug.php diff -u php-bugs-web/bug.php:1.60 php-bugs-web/bug.php:1.61 --- php-bugs-web/bug.php:1.60 Thu Jan 22 21:33:31 2004 +++ php-bugs-web/bug.php Thu Jan 22 22:05:28 2004 @@ -6,7 +6,6 @@ } $edit = (int)$edit; -require_once 'config.php'; require_once 'prepend.inc'; require_once 'cvs-auth.inc'; require_once 'trusted-devs.inc'; @@ -23,10 +22,9 @@ list($user,$pw) = explode(":", base64_decode($MAGIC_COOKIE)); } - -@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) +@mysql_connect("localhost","nobody","") or die("Unable to connect to SQL server."); -@mysql_select_db(BUG_DB_NAME); +@mysql_select_db("php3"); # fetch info about the bug into $bug $query = "SELECT id,bug_type,email,passwd,sdesc,ldesc," @@ -41,7 +39,7 @@ $res = mysql_query($query); -if ($res) $bug = mysql_fetch_assoc($res); +if ($res) $bug = mysql_fetch_array($res,MYSQL_ASSOC); if (!$res || !$bug) { commonHeader("No such bug."); echo "<h1 class=\"error\">No such bug #$id!</h1>"; @@ -56,7 +54,7 @@ delete_comment($id, $delete_comment); $addon = '&thanks=1'; } - header("Location: " . $_SERVER['PHP_SELF'] . "?id=$id&edit=1$addon"); + header("Location: $PHP_SELF?id=$id&edit=1$addon"); exit(); } @@ -71,7 +69,7 @@ # Don't allow comments by the original report submitter if (stripslashes($in['commentemail']) == $bug['email']) { - header("Location: " . $_SERVER['PHP_SELF'] . "?id=$id&edit=2"); + header("Location: $PHP_SELF?id=$id&edit=2"); exit(); } @@ -90,13 +88,13 @@ if (!$errors) { $query = "INSERT INTO bugdb_comments (bug,email,ts,comment) VALUES" - . " ('$id', '" . $in['commentemail'] . "',NOW(),'$ncomment')"; + . " ('$id','$in[commentemail]',NOW(),'$ncomment')"; $success = @mysql_query($query); } $from = stripslashes($in['commentemail']); } elseif ($in && $edit == 2) { - if (!$bug['passwd'] || $bug['passwd'] != stripslashes($pw)) { + if (!$bug[passwd] || $bug[passwd] != stripslashes($pw)) { $errors[] = "The password you supplied was incorrect."; } @@ -119,7 +117,7 @@ } } - $from = ($bug['email'] != $in['email'] && !empty($in['email'])) ? $in['email'] : $bug['email']; + $from = ($bug[email] != $in[email] && !empty($in[email])) ? $in[email] : $bug[email]; if (!$errors && !($errors = incoming_details_are_valid($in))) { /* update bug record */ @@ -176,7 +174,7 @@ if ($in && !$errors && $success) { mail_bug_updates($bug,$in,$from,$ncomment,$edit); - header("Location: " . $_SERVER['PHP_SELF'] . "?id=$id&thanks=$edit"); + header("Location: $PHP_SELF?id=$id&thanks=$edit"); exit; } @@ -252,11 +250,11 @@ <div id="controls"> <?php -function control($num, $desc) { +function control($num,$desc) { $active = ($GLOBALS['edit'] == $num); echo "<span id=\"control_$num\" class=\"control", ($active ? ' active' : ''), "\">", - !$active ? "<a href=\"" . $_SERVER['PHP_SELF'] . "?id=" . $GLOBALS['id'] . ($num ? "&amp;edit=$num" : "")."\">" : "", - $desc, !$active ? "</a>" : "", "</span>"; + !$active ? "<a href=\"$PHP_SELF?id=$GLOBALS[id]".($num ? "&amp;edit=$num" : "")."\">" : "", + $desc, !$active ? "</a>" : "", "</span> "; } control(0,'View/Vote'); @@ -280,7 +278,7 @@ } if ($edit == 1 || $edit == 2) {?> -<form id="update" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> +<form id="update" action="<?php echo $PHP_SELF?>" method="post"> <?php if ($edit == 2) { if (!$in && $pw && $bug['passwd'] && stripslashes($pw)==$bug['passwd']) {?> @@ -295,7 +293,7 @@ <?php if (!$in) {?> Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can <a -href="<?php echo $_SERVER['PHP_SELF'] . "?id=$id&amp;edit=3"?>">add a comment by following +href="<?php echo "$PHP_SELF?id=$id&amp;edit=3"?>">add a comment by following this link</a> or the box above that says 'Add Comment'. If this is your bug, but you forgot your password, <a href="bug-pwd-finder.php">you can retrieve your password here</a>. @@ -329,9 +327,9 @@ <div class="explain"> <?php if (!$in) {?> Welcome! If you don't have a CVS account, you can't do anything here. You can -<a href="<?php echo $_SERVER['PHP_SELF'] . "?id=$id&amp;edit=3"; ?>">add a comment by following +<a href="<?php echo "$PHP_SELF?id=$id&amp;edit=3"?>">add a comment by following this link</a> or if you reported this bug, you can <a href="<?php echo -$_SERVER['PHP_SELF'] . "?id=$id&amp;edit=2"?>">edit this bug over here</a>. +"$PHP_SELF?id=$id&amp;edit=2"?>">edit this bug over here</a>. <?php }?> <table> <tr> @@ -398,13 +396,13 @@ </form> <?php }?> <?php if ($edit == 3) {?> -<form id="comment" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> +<form id="comment" action="<?php echo $PHP_SELF?>" method="post"> <?php if (!$in) {?> <div class="explain"> Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please -<?php if (canvote()) { echo " &mdash; but make sure to <a href=\"" . $_SERVER['PHP_SELF'] . "?id=$id\">vote on the bug</a>"; } ?>! +<?php if (canvote()) { echo " &mdash; but make sure to <a href=\"$PHP_SELF?id=$id\">vote on the bug</a>"; } ?>! </div> <?php }?> <table> @@ -478,7 +476,7 @@ . " FROM bugdb_comments WHERE bug=$id ORDER BY ts"; $res = @mysql_query($query); if ($res) { - while ($row = mysql_fetch_assoc($res)) { + while ($row = mysql_fetch_array($res,MYSQL_ASSOC)) { output_note($row['id'], $row['added'], $row['email'], $row['comment']); } } @@ -491,10 +489,10 @@ echo "<div class=\"comment\">"; echo "<b>[",format_date($ts),"] ", htmlspecialchars(spam_protect($email)), "</b>\n"; - echo ($edit == 1 && $com_id !== 0 && in_array($user, $trusted_developers)) ? "<a href=\"" . $_SERVER['PHP_SELF'] . "?id=$id&amp;edit=1&amp;delete_comment=$com_id\">[delete]</a>\n" : ''; + echo ($edit == 1 && $com_id !== 0 && in_array($user, $trusted_developers)) ? "<a href=\"$PHP_SELF?id=$id&amp;edit=1&amp;delete_comment=$com_id\">[delete]</a>\n" : ''; echo "<pre class=\"note\">"; $note = addlinks(preg_replace("/(\r?\n){3,}/","\n\n",wordwrap($comment,72,"\n",1))); - echo preg_replace('/(bug\ *#([0-9]+))/i', "<a href=\"" . $_SERVER['PHP_SELF'] . "?id=\\2\">\\1</a>", $note); + echo preg_replace('/(bug\ *#([0-9]+))/i', "<a href=\"$PHP_SELF?id=\\2\">\\1</a>", $note); echo "</pre>\n"; echo "</div>"; } http://cvs.php.net/diff.php/php-bugs-web/bugstats.php?r1=1.20&r2=1.21&ty=u Index: php-bugs-web/bugstats.php diff -u php-bugs-web/bugstats.php:1.20 php-bugs-web/bugstats.php:1.21 --- php-bugs-web/bugstats.php:1.20 Thu Jan 22 21:33:31 2004 +++ php-bugs-web/bugstats.php Thu Jan 22 22:05:28 2004 @@ -1,22 +1,17 @@ <?php /* vim: set noet ts=4 sw=4: : */ + require_once 'prepend.inc'; -require_once 'config.php'; commonHeader("Statistics"); -@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) - or die("unable to connect to database" . mysql_error()); -@mysql_select_db(BUG_DB_NAME) +@mysql_connect("localhost","nobody","") + or die("unable to connect to database"); +@mysql_select_db("php3") or die("unable to select database"); $query = "SELECT status,bug_type,email,php_version,php_os FROM bugdb"; -// did we ask for a specific version ? -if (isset($_GET['phpver'])) { - $phpver = $_GET['phpver']; -} - -if (isset($phpver) && $phpver > 0) { +if ($phpver > 0) { $query .= " WHERE SUBSTRING(php_version,1,1) = '$phpver'"; } @@ -24,27 +19,21 @@ $result = mysql_unbuffered_query($query); -$total = 0; - -while ($row = mysql_fetch_assoc($result)) { - $bug_type['all'][$row['bug_type']]++; +while ($row = mysql_fetch_array($result)) { + $bug_type['all'][$row[bug_type]]++; $status_str = strtolower($row['status']); - $bug_type[$status_str][$row['bug_type']]++; + $bug_type[$status_str][$row[bug_type]]++; $bug_type[$status_str]['all']++; - $email[$row['email']]++; - $php_version[$row['php_version']]++; - $php_os[$row['php_os']]++; + $email[$row[email]]++; + $php_version[$row[php_version]]++; + $php_os[$row[php_os]]++; $status[$row['status']]++; $total++; } // Exit if there are no bugs for this version if ($total == 0) { - echo '<p>No bugs found'; - if (isset($phpver)) { - echo ' for this PHP version'; - } - echo '</p>'; + echo '<p>No bugs found for this PHP version</p>'; commonFooter(); exit; } @@ -169,7 +158,7 @@ $query .= " AND SUBSTRING(php_version,1,1) = '$phpver'"; } $res = mysql_query($query); -$row = mysql_fetch_assoc($res); +$row = mysql_fetch_array($res); $half = $row['count']/2; $query = "SELECT UNIX_TIMESTAMP(ts2)-UNIX_TIMESTAMP(ts1) AS half FROM bugdb WHERE ts2 > ts1"; http://cvs.php.net/diff.php/php-bugs-web/fix.php?r1=1.15&r2=1.16&ty=u Index: php-bugs-web/fix.php diff -u php-bugs-web/fix.php:1.15 php-bugs-web/fix.php:1.16 --- php-bugs-web/fix.php:1.15 Thu Jan 22 21:33:31 2004 +++ php-bugs-web/fix.php Thu Jan 22 22:05:28 2004 @@ -6,7 +6,6 @@ } require_once 'prepend.inc'; -require_once 'config.php'; require_once 'cvs-auth.inc'; $mail_bugs_to = 'php-bugs@lists.php.net'; @@ -40,7 +39,7 @@ commonHeader("Resolve Bug"); display_errors($errors); ?> -<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> +<form method="post" action="<?php echo $PHP_SELF?>"> <input type="hidden" name="id" value="<?php echo $id?>" /> <table> <tr> @@ -71,9 +70,9 @@ exit; } -@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) +@mysql_connect("localhost","nobody","") or die("Unable to connect to SQL server."); -@mysql_select_db(BUG_DB_NAME); +@mysql_select_db("php3"); # fetch info about the bug into $bug $query = "SELECT id,bug_type,email,passwd,sdesc,ldesc," @@ -83,7 +82,7 @@ $res = mysql_query($query); -if ($res) $bug = mysql_fetch_assoc($res); +if ($res) $bug = mysql_fetch_array($res,MYSQL_ASSOC); if (!$res || !$bug) { commonHeader("No such bug."); echo "<h1 class=\"error\">No such bug #$id!</h1>"; http://cvs.php.net/diff.php/php-bugs-web/lbugs.php?r1=1.10&r2=1.11&ty=u Index: php-bugs-web/lbugs.php diff -u php-bugs-web/lbugs.php:1.10 php-bugs-web/lbugs.php:1.11 --- php-bugs-web/lbugs.php:1.10 Thu Jan 22 21:33:31 2004 +++ php-bugs-web/lbugs.php Thu Jan 22 22:05:28 2004 @@ -1,15 +1,14 @@ <?php /* vim: set noet ts=4 sw=4: : */ -require_once 'config.php'; -mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) +mysql_connect("localhost","nobody","") or die("Unable to connect to SQL server\n"); -mysql_select_db(BUG_DB_NAME); +mysql_select_db("php3"); if ($id) { $result = mysql_query("SELECT id,bug_type,email,sdesc,ldesc,php_version,php_os,status,ts1,assign FROM bugdb WHERE id=$id"); if(!$result) { echo mysql_error(); exit; } if ($num = mysql_num_rows($result)) { - $row = mysql_fetch_assoc($result); + $row = mysql_fetch_array($result); echo "<pre><h1>Bug $id</h1>\n"; echo "<b>From : " . htmlspecialchars($row['email']) . "\n"; echo "Date : " . $row['ts1'] . "\n"; @@ -21,7 +20,7 @@ echo "\n" . htmlspecialchars($row['ldesc']) . "\n\n"; $query = "SELECT * FROM bugdb_comments WHERE bug=$id ORDER BY ts"; if ($comresult = mysql_query($query)) { - while ($com = mysql_fetch_assoc($comresult)) { + while ($com = mysql_fetch_array($comresult)) { echo "<b><i>[",$com['ts'],"] ",$com['email'],"</i></b><br>\n"; $text = addlinks($com['comment']); echo "<blockquote>",$text,"</blockquote>\n"; @@ -38,7 +37,7 @@ echo "<h1>PHP 4.x Bug Database Summary</h1>"; echo "<pre> Num Status Summary ($num total including feature requests)\n"; $last_group = ""; - while ($row = mysql_fetch_assoc($result)) { + while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) { if ($last_group != $row[bug_type]) { $last_group = $row[bug_type]; echo "===============================================[<b>".$row[bug_type]."]"; @@ -47,7 +46,7 @@ for($i=0;$i<$len; $i++) $s.= "="; echo "$s</b>\n"; } - printf("<a href=\"%s?id=%d\">%4d</a>", $_SERVER['PHP_SELF'], $row['id'], $row['id']); + printf("<a href=\"%s?id=%d\">%4d</a>",$PHP_SELF,$row[id],$row[id]); printf(" %-9s ",$row[status]); echo " ".htmlspecialchars($row[sdesc])."\n"; } http://cvs.php.net/diff.php/php-bugs-web/lstats.php?r1=1.15&r2=1.16&ty=u Index: php-bugs-web/lstats.php diff -u php-bugs-web/lstats.php:1.15 php-bugs-web/lstats.php:1.16 --- php-bugs-web/lstats.php:1.15 Thu Jan 22 21:33:31 2004 +++ php-bugs-web/lstats.php Thu Jan 22 22:05:28 2004 @@ -1,6 +1,5 @@ <?php /* vim: set noet ts=4 sw=4: : */ -require_once 'config.php'; function status_print ($status, $num, $width, $align='left') { $str = ucfirst($status).":"; $str.= str_repeat(" ", $width - strlen($str) + (($align == 'right') ? (4 - strlen($num)) : 0)); @@ -12,7 +11,7 @@ { global $phpver; - $query = "SELECT count(id) AS total from bugdb WHERE"; + $query = "SELECT count(id) from bugdb WHERE"; if ($phpver > 0) { $query .= " php_version LIKE '" . $phpver . "%' AND"; @@ -29,9 +28,9 @@ $query.= "AND bug_type NOT IN($excluded)"; $result=mysql_unbuffered_query($query); - $row=mysql_fetch_assoc($result); + $row=mysql_fetch_row($result); mysql_freeresult($result); - return $row['total']; + return $row[0]; } $statuses = array ( @@ -53,8 +52,8 @@ echo "<h3>Bug stats for PHP $phpver:</h3>\n<pre>\n"; } -mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS); -mysql_select_db(BUG_DB_NAME); +mysql_connect("localhost","nobody",""); +mysql_select_db("php3"); if (isset($per_category)) { include ('bugtypes.inc'); http://cvs.php.net/diff.php/php-bugs-web/report.php?r1=1.48&r2=1.49&ty=u Index: php-bugs-web/report.php diff -u php-bugs-web/report.php:1.48 php-bugs-web/report.php:1.49 --- php-bugs-web/report.php:1.48 Thu Jan 22 21:33:31 2004 +++ php-bugs-web/report.php Thu Jan 22 22:05:28 2004 @@ -1,7 +1,6 @@ <?php /* vim: set noet ts=4 sw=4: : */ require_once 'prepend.inc'; -require_once 'config.php'; require_once 'cvs-auth.inc'; /* When user submits a report, do a search and display the results before allowing @@ -18,18 +17,13 @@ $mail_bugs_to = "php-bugs@lists.php.net"; -@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) +@mysql_connect("localhost","nobody","") or die("Unable to connect to SQL server."); -@mysql_select_db(BUG_DB_NAME); - -if (isset($_POST['in'])) { - $in = $_POST['in']; -} - +@mysql_select_db("php3"); $errors = array(); -if (isset($in) && $in) { - if (!($errors = incoming_details_are_valid($in, 1))) { +if ($in) { + if (!($errors = incoming_details_are_valid($_POST['in'], 1))) { if (!$in['did_luser_search']) { @@ -78,7 +72,7 @@ </tr> <?php - while ($row = mysql_fetch_assoc($res)) { + while ($row = mysql_fetch_array($res)) { $resolution = mysql_get_one("SELECT comment from bugdb_comments where bug = " . $row['id'] . " order by id desc limit 1"); @@ -237,25 +231,8 @@ } if ($errors) display_errors($errors); - -if (!isset($in)) { - $in = array( - 'email' => '', - 'php_version' => '', - 'bug_type' => '', - 'php_os' => '', - 'did_luser_search' => '', - 'sdesc' => '', - 'passwd' => '', - 'ldesc' => '', - 'repcode' => '', - 'actres' => '', - 'expres' => '' - ); -} - ?> -<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"> +<form method="post" action="<?php echo $PHP_SELF;?>"> <input type="hidden" name="in[did_luser_search]" value="<?php echo $in['did_luser_search'] ? 1 : 0; ?>" /> <table> <tr> http://cvs.php.net/diff.php/php-bugs-web/search.php?r1=1.55&r2=1.56&ty=u Index: php-bugs-web/search.php diff -u php-bugs-web/search.php:1.55 php-bugs-web/search.php:1.56 --- php-bugs-web/search.php:1.55 Thu Jan 22 21:33:31 2004 +++ php-bugs-web/search.php Thu Jan 22 22:05:28 2004 @@ -1,12 +1,11 @@ <?php /* vim: set noet ts=4 sw=4: : */ -require_once 'config.php'; require_once 'prepend.inc'; if (isset($MAGIC_COOKIE) && !isset($user) && !isset($pw)) { list($user,$pw) = explode(":", base64_decode($MAGIC_COOKIE)); } -if (isset($search_for) && !preg_match("/\\D/",trim($search_for))) { +if ($search_for && !preg_match("/\\D/",trim($search_for))) { $x = $pw ? ($user ? "&edit=1" : "&edit=2") : ""; header("Location: bug.php?id=$search_for$x"); exit; @@ -20,9 +19,9 @@ define('BOOLEAN_SEARCH', @intval($boolean)); if (isset($cmd) && $cmd == "display") { - @mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) + @mysql_connect("localhost","nobody","") or die("Unable to connect to SQL server."); - @mysql_select_db(BUG_DB_NAME); + @mysql_select_db("php3"); $mysql4 = version_compare(mysql_get_server_info(), "4.0.0", "ge"); @@ -104,7 +103,7 @@ if ($order_by || $reorder_by || !strlen($search_for)) { if (!in_array($order_by,$allowed_order)) $order_by = "id"; if (isset($reorder_by) && !in_array($reorder_by,$allowed_order)) $reorder_by = "id"; - if (isset($direction) && $direction != "DESC") $direction = "ASC"; + if ($direction != "DESC") $direction = "ASC"; if ($reorder_by) { if ($order_by == $reorder_by) { @@ -156,7 +155,7 @@ } } - $link = $_SERVER['PHP_SELF'] . "?cmd=display" . + $link = "$PHP_SELF?cmd=display" . $bug_type_string . $bug_ntype_string . "&amp;status=" . urlencode(stripslashes($status)) . @@ -180,25 +179,25 @@ </tr> <?php if ($warnings) display_warnings($warnings); - while ($row = mysql_fetch_assoc($res)) { + while ($row = mysql_fetch_array($res)) { echo '<tr bgcolor="', get_row_color($row), '">'; /* Bug ID */ - echo "<td align=\"center\"><a href=\"bug.php?id=" . $row['id'] . "\">" . $row['id'] . "</a>"; - echo "<br /><a href=\"bug.php?id=" . $row['id'] . "&amp;edit=1\">(edit)</a></td>"; + echo "<td align=\"center\"><a href=\"bug.php?id=$row[id]\">$row[id]</a>"; + echo "<br /><a href=\"bug.php?id=$row[id]&amp;edit=1\">(edit)</a></td>"; /* Date */ - echo "<td align=\"center\">".date ("Y-m-d H:i:s", strtotime ($row['ts1']))."</td>"; - echo "<td>", htmlspecialchars($row['bug_type']), "</td>"; - echo "<td>", htmlspecialchars($row['status']); - if ($row['status'] == "Feedback" && $row['unchanged'] > 0) { - printf ("<br>%d day%s", $row['unchanged'], $row['unchanged'] > 1 ? "s" : ""); + echo "<td align=\"center\">".date ("Y-m-d H:i:s", strtotime ($row[ts1]))."</td>"; + echo "<td>", htmlspecialchars($row[bug_type]), "</td>"; + echo "<td>", htmlspecialchars($row[status]); + if ($row[status] == "Feedback" && $row[unchanged] > 0) { + printf ("<br>%d day%s", $row[unchanged], $row[unchanged] > 1 ? "s" : ""); } echo "</td>"; - echo "<td>", htmlspecialchars($row['php_version']), "</td>"; - echo "<td>", $row['php_os'] ? htmlspecialchars($row['php_os']) : "&nbsp;", "</td>"; - echo "<td>", $row['sdesc'] ? htmlspecialchars($row['sdesc']) : "&nbsp;", "</td>"; - echo "<td>", $row['assign'] ? htmlspecialchars($row['assign']) : "&nbsp;", "</td>"; + echo "<td>", htmlspecialchars($row[php_version]), "</td>"; + echo "<td>", $row[php_os] ? htmlspecialchars($row[php_os]) : "&nbsp;", "</td>"; + echo "<td>", $row[sdesc] ? htmlspecialchars($row[sdesc]) : "&nbsp;", "</td>"; + echo "<td>", $row[assign] ? htmlspecialchars($row[assign]) : "&nbsp;", "</td>"; echo "</tr>\n"; } @@ -215,21 +214,21 @@ if ($errors) display_errors($errors); if ($warnings) display_warnings($warnings); ?> -<form id="asearch" method="get" action="<?php echo $_SERVER['PHP_SELF'];?>"> +<form id="asearch" method="get" action="<?php echo $PHP_SELF?>"> <table id="primary" width="95%"> <tr> <th>Find bugs</th> <td nowrap="nowrap">with all or any of the words</td> - <td><input type="text" name="search_for" value="<?php if (isset($search_for)) echo htmlspecialchars(stripslashes($search_for));?>" size="20" maxlength="255" /> + <td><input type="text" name="search_for" value="<?php echo htmlspecialchars(stripslashes($search_for));?>" size="20" maxlength="255" /> <br><?php show_boolean_options(BOOLEAN_SEARCH) ?> (<?php print_link('search-howto.php', '?', true);?>)</td> <td rowspan="2"> <select name="limit"><?php show_limit_options($limit);?></select> <br /> <select name="order_by"><?php show_order_options($limit);?></select> <br /> - <input type="radio" name="direction" value="ASC" <?php if(!isset($direction) || (isset($direction) && $direction != "DESC")) { echo('checked="checked"'); }?>/>Ascending + <input type="radio" name="direction" value="ASC" <?php if($direction != "DESC") { echo('checked="checked"'); }?>/>Ascending &nbsp; - <input type="radio" name="direction" value="DESC" <?php if(isset($direction) && $direction == "DESC") { echo('checked="checked"'); }?>/>Descending + <input type="radio" name="direction" value="DESC" <?php if($direction == "DESC") { echo('checked="checked"'); }?>/>Descending <br /> <input type="hidden" name="cmd" value="display" /> <input type="submit" value="Search" /> http://cvs.php.net/diff.php/php-bugs-web/source.php?r1=1.4&r2=1.5&ty=u Index: php-bugs-web/source.php diff -u php-bugs-web/source.php:1.4 php-bugs-web/source.php:1.5 --- php-bugs-web/source.php:1.4 Thu Jan 22 18:27:04 2004 +++ php-bugs-web/source.php Thu Jan 22 22:05:28 2004 @@ -8,15 +8,17 @@ commonFooter(); exit; } +?> +Source of: <? echo htmlspecialchars($url); ?><BR> -echo 'Source of: ' . htmlspecialchars($url) . '<br />'; +<? echo hdelim(); $legal_dirs = array( "/manual" => 1, "/include" => 1, - "/stats" => 1); + "/stats" => 1); $dir = dirname($url); if ($dir && $legal_dirs[$dir]) { @@ -40,11 +42,12 @@ The syntax highlighted source is automatically generated by PHP from the plaintext script.<br> If you're interested in what's behind the <B>commonHeader()</B> and <B>commonFooter()</B> functions, you can always take a look at the source of the -<?php print_link("/source.php?url=/include/layout.inc", "layout.inc"); ?> files. +<? print_link("/source.php?url=/include/layout.inc", "layout.inc"); ?> files. And, of course, if you want to see the source of this page, have a look -<?php print_link("/source.php?url=/source.php", "here"); ?>. +<? print_link("/source.php?url=/source.php", "here"); ?>. </P> -<?php - commonFooter(); +<? + +commonFooter(); ?> http://cvs.php.net/diff.php/php-bugs-web/vote.php?r1=1.8&r2=1.9&ty=u Index: php-bugs-web/vote.php diff -u php-bugs-web/vote.php:1.8 php-bugs-web/vote.php:1.9 --- php-bugs-web/vote.php:1.8 Thu Jan 22 21:33:31 2004 +++ php-bugs-web/vote.php Thu Jan 22 22:05:28 2004 @@ -1,5 +1,4 @@ <?php /* vim: set noet ts=4 sw=4: : */ -require_once 'config.php'; require_once 'prepend.inc'; if (!($id = (int)$id)) { @@ -18,9 +17,9 @@ $samever = (int)$samever; $sameos = (int)$sameos; -@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) +@mysql_connect("localhost","nobody","") or die("Unable to connect to SQL server."); -@mysql_select_db(BUG_DB_NAME); +@mysql_select_db("php3"); $ip = ip2long($HTTP_X_FORWARDED_FOR ? $HTTP_X_FORWARDED_FOR : $REMOTE_ADDR); // TODO: check if ip address has been banned. hopefully this will http://cvs.php.net/diff.php/php-bugs-web/include/functions.inc?r1=1.109&r2=1.110&ty=u Index: php-bugs-web/include/functions.inc diff -u php-bugs-web/include/functions.inc:1.109 php-bugs-web/include/functions.inc:1.110 --- php-bugs-web/include/functions.inc:1.109 Thu Jan 22 18:27:04 2004 +++ php-bugs-web/include/functions.inc Thu Jan 22 22:05:29 2004 @@ -125,7 +125,7 @@ echo "<option", ($current == $v ? " selected" : ""), ">$v</option>\n"; if ($current == $v) $use++; } - if (!isset($use) && $current) echo "<option selected>$current</option>\n"; + if (!$use && $current) echo "<option selected>$current</option>\n"; echo "<option value=\"earlier\">Earlier? Upgrade first!</option>\n"; } @@ -183,7 +183,7 @@ if ($key == $current) $use++; } } - if (!isset($use) && $current && !is_array ($current)) { + if (!$use && $current && !is_array ($current)) { echo "<option selected>$current</option>\n"; } } @@ -397,16 +397,14 @@ function get_old_comments ($bug_id, $all = 0) { - $divider = str_repeat("-", 72); - $max_message_length = 10 * 1024; + $divider = str_repeat("-", 72); + $max_message_length = 10 * 1024; $max_comments = 5; $output = ""; $count = 0; - $res = @mysql_query("SELECT ts, email, comment FROM bugdb_comments WHERE bug=$bug_id ORDER BY ts DESC"); + $res = @mysql_query("SELECT ts, email, comment FROM bugdb_comments WHERE bug=$bug_id ORDER BY ts DESC"); - if (!$res) { - return ''; - } + if (!$res) return ""; # skip the most recent unless the caller wanted all comments if (!$all) { @@ -414,16 +412,16 @@ if (!$row) return ""; } - while (($row = mysql_fetch_assoc($res)) && strlen($output) < $max_message_length && $count++ < $max_comments) { - $output .= "[" . $row['ts'] . "] ". spam_protect($row['email']) ."\n\n" . $row['comment'] . "\n\n$divider\n\n"; + while (($row = mysql_fetch_row($res)) && strlen($output) < $max_message_length && $count++ < $max_comments) { + $output .= "[$row[0]] ". spam_protect($row[1]) ."\n\n$row[2]\n\n$divider\n\n"; } if (strlen($output) < $max_message_length && $count < $max_comments) { $res=@mysql_query("SELECT ts1,email,ldesc FROM bugdb WHERE id=$bug_id"); if (!$res) return $output; - $row = mysql_fetch_assoc($res); + $row = mysql_fetch_row($res); if (!$row) return $output; - return ("\n\nPrevious Comments:\n$divider\n\n" . $output . "[" . $row['ts1'] . "] ". spam_protect($row['email']) ."\n\n" . $row['ldesc'] . "\n\n$divider\n\n"); + return ("\n\nPrevious Comments:\n$divider\n\n" . $output . "[$row[0]] ". spam_protect($row[1]) ."\n\n$row[2]\n\n$divider\n\n"); } else { return ("\n\nPrevious Comments:\n$divider\n\n" . $output . "The remainder of the comments for this report are too long. To view\nthe rest of the comments, please view the bug report online at\n http://bugs.php.net/$bug_id\n"); http://cvs.php.net/diff.php/php-bugs-web/include/layout.inc?r1=1.21&r2=1.22&ty=u Index: php-bugs-web/include/layout.inc diff -u php-bugs-web/include/layout.inc:1.21 php-bugs-web/include/layout.inc:1.22 --- php-bugs-web/include/layout.inc:1.21 Thu Jan 22 18:27:04 2004 +++ php-bugs-web/include/layout.inc Thu Jan 22 22:05:29 2004 @@ -4,7 +4,7 @@ # function spacer($width=1, $height=1, $align=false, $extras=false) { - printf('<img src="gifs/spacer.gif" width="%d" height="%d" border="0" alt="" %s%s>', + printf('<img src="/gifs/spacer.gif" width="%d" height="%d" border="0" alt="" %s%s>', $width, $height, ($align ? 'align="'.$align.'" ' : ''), @@ -34,11 +34,11 @@ function make_image($file, $alt=false, $align=false, $extras=false, $dir=false, $border=0) { global $HTTP_SERVER_VARS; if (!$dir) { - $dir = 'gifs'; + $dir = '/gifs'; } - if (is_string($dir)) { - $dir = "$dir"; - } + if (is_string($dir) && $dir{0} != "/") { + $dir = "/$dir"; + } $path = $HTTP_SERVER_VARS['DOCUMENT_ROOT']."$dir/$file"; if ($size = @getimagesize($path)) { $image = sprintf('<img src="%s/%s" border="%d" %s alt="%s" %s%s>', @@ -80,7 +80,7 @@ # function make_submit($file, $alt=false, $align=false, $extras=false, $dir=false, $border=0) { if (!$dir) { - $dir = 'gifs'; + $dir = '/gifs'; } $return = make_image($file, $alt, $align, $extras, $dir, $border); if ($return != "<img>") { @@ -240,8 +240,8 @@ <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr class="headersep"><td><?php spacer(1,1);?><br></td></tr> <tr class="headerbottom"> - <td align="right" valign="bottom"><?php - print_link('source.php?url='.$HTTP_SERVER_VARS['SCRIPT_NAME'], 'show source', false, 'class="menuWhite"'); + <td align="right" valign="bottom"><? + print_link('/source.php?url='.$HTTP_SERVER_VARS['SCRIPT_NAME'], 'show source', false, 'class="menuWhite"'); ?>&nbsp;<br> </td> </tr> http://cvs.php.net/diff.php/php-bugs-web/rss/bug.php?r1=1.4&r2=1.5&ty=u Index: php-bugs-web/rss/bug.php diff -u php-bugs-web/rss/bug.php:1.4 php-bugs-web/rss/bug.php:1.5 --- php-bugs-web/rss/bug.php:1.4 Thu Jan 22 21:33:32 2004 +++ php-bugs-web/rss/bug.php Thu Jan 22 22:05:30 2004 @@ -10,11 +10,9 @@ $id = (int)$_REQUEST['id']; $format = $_REQUEST['format']; -include 'config.php'; - -@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) +@mysql_connect("localhost","nobody","") or die("Unable to connect to SQL server."); -@mysql_select_db(BUG_DB_NAME); +@mysql_select_db("php3"); $query = "SELECT id,bug_type,email,sdesc,ldesc," . "php_version,php_os,status,ts1 as ts_submitted,ts2 as ts_modified,assign," @@ -28,7 +26,7 @@ $res = @mysql_query($query); -if ($res) $bug = mysql_fetch_assoc($res); +if ($res) $bug = mysql_fetch_array($res,MYSQL_ASSOC); if (!$res || !$bug) { outputHeader(array(),$format); outputFooter($format); @@ -76,7 +74,7 @@ } function outputbug($bug, $res, $format) { - while ($row = mysql_fetch_assoc($res)) { + while ($row = mysql_fetch_array($res,MYSQL_ASSOC)) { switch ($format) { case 'xml': echo " <comment>\n"; http://cvs.php.net/diff.php/php-bugs-web/scripts/email-bug-summaries?r1=1.6&r2=1.7&ty=u Index: php-bugs-web/scripts/email-bug-summaries diff -u php-bugs-web/scripts/email-bug-summaries:1.6 php-bugs-web/scripts/email-bug-summaries:1.7 --- php-bugs-web/scripts/email-bug-summaries:1.6 Thu Jan 22 21:33:33 2004 +++ php-bugs-web/scripts/email-bug-summaries Thu Jan 22 22:05:30 2004 @@ -1,15 +1,13 @@ #!/usr/local/bin/php -q -<?php - - require_once 'config.php'; - mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server\n"); - mysql_select_db(BUG_DB_NAME); +<? + mysql_connect("localhost","nobody","") or die("Unable to connect to SQL server\n"); + mysql_select_db("php3"); $result = mysql_query("select id,bug_type,status,sdesc,assign from bugdb where status not in ('Closed', 'Bogus', 'Duplicate', 'No Feedback', 'Wont fix') and php_version like '4%' order by bug_type,id"); if($num=mysql_num_rows($result)) { $body = " PHP 4 Bug Database summary - http://bugs.php.net\n\n"; $body .= " Num Status Summary ($num total including feature requests)\n"; $last_group = ""; - while($row = mysql_fetch_assoc($result)) { + while($row = mysql_fetch_array($result,MYSQL_ASSOC)) { if($row['status']=='Assigned') { $ass[$row['assign']][$row['id']] = $row['sdesc']; } http://cvs.php.net/diff.php/php-bugs-web/scripts/no-feedback?r1=1.6&r2=1.7&ty=u Index: php-bugs-web/scripts/no-feedback diff -u php-bugs-web/scripts/no-feedback:1.6 php-bugs-web/scripts/no-feedback:1.7 --- php-bugs-web/scripts/no-feedback:1.6 Thu Jan 22 21:33:33 2004 +++ php-bugs-web/scripts/no-feedback Thu Jan 22 22:05:30 2004 @@ -2,7 +2,6 @@ <?php /* vim: set ft=php3 noet ts=4 sw=4 : */ require dirname(__FILE__).'/../include/functions.inc'; -require_once 'config.php'; # this script closes bugs due to lack of feedback. @@ -17,9 +16,9 @@ $mail_bugs_to = 'php-bugs@lists.php.net'; -mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) +mysql_connect("localhost", "nobody", "") or die("unable to connect to database"); -mysql_select_db(BUG_DB_NAME) +mysql_select_db("php3") or die("unable to select db"); # fetch info about the bug into $bug @@ -39,7 +38,7 @@ $in = array('status' => 'No Feedback'); -while ($bug = mysql_fetch_assoc($result)) { +while ($bug = mysql_fetch_array($result,MYSQL_ASSOC)) { list($mailto,$mailfrom) = get_bugtype_mail($bug['bug_type']); mysql_query("INSERT bugdb_comments SET bug=$bug[id],email='$mailfrom',ts=NOW(),comment='".addslashes($message)."'");
« previous php.mirrors (#23131) next »