cvs: php-bugs-web / .htaccess bug-pwd-finder.php bug.php bugstats.php fix.php lbugs.php lstats.php report.php search.php source.php vote.php /include
config.php functions.inc layout.inc /rss bug.php /scripts email-bug-summaries no-feedback
| From: | Mehdi Achour | Date: | Thu, 22 Jan 2004 23:27:06 +0000 |
| Subject: | cvs: php-bugs-web / .htaccess bug-pwd-finder.php bug.php bugstats.php fix.php lbugs.php lstats.php report.php search.php source.php vote.php /include config.php 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-23122@lists.php.net to get a copy of this message | ||
didou Thu Jan 22 18:27:06 2004 EDT
Added files:
/php-bugs-web/include config.php
Modified files:
/php-bugs-web .htaccess 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:
- Added php-bugs-web/include/ in the include_patch via .htaccess
- Changed the images locations so that they are seeked in a more relative way
- Added a configuration file that is prepended everywhere. This file only defin
e the MySQL settings for the moment.
- Coded with register_globals Off and error_reporting E_ALL and fixed some issu
es
- Changed the nasty mysql_fetch_(row|array) calls to a mysql_fetch_assoc() one
http://cvs.php.net/diff.php/php-bugs-web/.htaccess?r1=1.1&r2=1.2&ty=u Index: php-bugs-web/.htaccess diff -u php-bugs-web/.htaccess:1.1 php-bugs-web/.htaccess:1.2 --- php-bugs-web/.htaccess:1.1 Mon Feb 17 17:58:12 2003 +++ php-bugs-web/.htaccess Thu Jan 22 18:27:03 2004 @@ -4,3 +4,5 @@ php_value register_globals 1 php_value magic_quotes_gpc 1 php_value magic_quotes_runtime 0 +php_value include_path ".:./include" +php_value auto_prepend_file "include/config.php" http://cvs.php.net/diff.php/php-bugs-web/bug-pwd-finder.php?r1=1.7&r2=1.8&ty=u Index: php-bugs-web/bug-pwd-finder.php diff -u php-bugs-web/bug-pwd-finder.php:1.7 php-bugs-web/bug-pwd-finder.php:1.8 --- php-bugs-web/bug-pwd-finder.php:1.7 Mon Dec 8 11:56:57 2003 +++ php-bugs-web/bug-pwd-finder.php Thu Jan 22 18:27:04 2004 @@ -5,10 +5,10 @@ if ($bug_id) { - mysql_connect ("localhost","nobody","") + mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server. Please try again later."); - mysql_select_db ("php3"); + mysql_select_db(BUG_DB_NAME); // Clean up the bug id $bug_id = ereg_replace ("[^0-9]+", "", $bug_id); @@ -63,7 +63,7 @@ <?php if ($msg) { echo "<p><font color=\"#cc0000\">$msg</font></p>"; } ?> -<form method="post" action="<?php echo $PHP_SELF;?>"> +<form method="post" action="<?php echo $_SERVER['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.58&r2=1.59&ty=u Index: php-bugs-web/bug.php diff -u php-bugs-web/bug.php:1.58 php-bugs-web/bug.php:1.59 --- php-bugs-web/bug.php:1.58 Fri Jan 2 11:49:05 2004 +++ php-bugs-web/bug.php Thu Jan 22 18:27:04 2004 @@ -22,9 +22,9 @@ list($user,$pw) = explode(":", base64_decode($MAGIC_COOKIE)); } -@mysql_connect("localhost","nobody","") +@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server."); -@mysql_select_db("php3"); +@mysql_select_db(BUG_DB_NAME); # fetch info about the bug into $bug $query = "SELECT id,bug_type,email,passwd,sdesc,ldesc," @@ -39,7 +39,7 @@ $res = mysql_query($query); -if ($res) $bug = mysql_fetch_array($res,MYSQL_ASSOC); +if ($res) $bug = mysql_fetch_assoc($res); if (!$res || !$bug) { commonHeader("No such bug."); echo "<h1 class=\"error\">No such bug #$id!</h1>"; @@ -54,7 +54,7 @@ delete_comment($id, $delete_comment); $addon = '&thanks=1'; } - header("Location: $PHP_SELF?id=$id&edit=1$addon"); + header("Location: " . $_SERVER['PHP_SELF'] . "?id=$id&edit=1$addon"); exit(); } @@ -69,7 +69,7 @@ # Don't allow comments by the original report submitter if (stripslashes($in['commentemail']) == $bug['email']) { - header("Location: $PHP_SELF?id=$id&edit=2"); + header("Location: " . $_SERVER['PHP_SELF'] . "?id=$id&edit=2"); exit(); } @@ -88,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."; } @@ -117,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 */ @@ -174,7 +174,7 @@ if ($in && !$errors && $success) { mail_bug_updates($bug,$in,$from,$ncomment,$edit); - header("Location: $PHP_SELF?id=$id&thanks=$edit"); + header("Location: " . $_SERVER['PHP_SELF'] . "?id=$id&thanks=$edit"); exit; } @@ -250,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=\"$PHP_SELF?id=$GLOBALS[id]".($num ? "&edit=$num" : "")."\">" : "", - $desc, !$active ? "</a>" : "", "</span> "; + !$active ? "<a href=\"" . $_SERVER['PHP_SELF'] . "?id=" . $GLOBALS['id'] . ($num ? "&edit=$num" : "")."\">" : "", + $desc, !$active ? "</a>" : "", "</span>"; } control(0,'View/Vote'); @@ -278,7 +278,7 @@ } if ($edit == 1 || $edit == 2) {?> -<form id="update" action="<?php echo $PHP_SELF?>" method="post"> +<form id="update" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <?php if ($edit == 2) { if (!$in && $pw && $bug['passwd'] && stripslashes($pw)==$bug['passwd']) {?> @@ -293,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 "$PHP_SELF?id=$id&edit=3"?>">add a comment by following +href="<?php echo $_SERVER['PHP_SELF'] . "?id=$id&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>. @@ -327,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 "$PHP_SELF?id=$id&edit=3"?>">add a comment by following +<a href="<?php echo $_SERVER['PHP_SELF'] . "?id=$id&edit=3"; ?>">add a comment by following this link</a> or if you reported this bug, you can <a href="<?php echo -"$PHP_SELF?id=$id&edit=2"?>">edit this bug over here</a>. +$_SERVER['PHP_SELF'] . "?id=$id&edit=2"?>">edit this bug over here</a>. <?php }?> <table> <tr> @@ -396,13 +396,13 @@ </form> <?php }?> <?php if ($edit == 3) {?> -<form id="comment" action="<?php echo $PHP_SELF?>" method="post"> +<form id="comment" action="<?php echo $_SERVER['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 " — but make sure to <a href=\"$PHP_SELF?id=$id\">vote on the bug</a>"; } ?>! +<?php if (canvote()) { echo " — but make sure to <a href=\"" . $_SERVER['PHP_SELF'] . "?id=$id\">vote on the bug</a>"; } ?>! </div> <?php }?> <table> @@ -476,7 +476,7 @@ . " FROM bugdb_comments WHERE bug=$id ORDER BY ts"; $res = @mysql_query($query); if ($res) { - while ($row = mysql_fetch_array($res,MYSQL_ASSOC)) { + while ($row = mysql_fetch_assoc($res)) { output_note($row['id'], $row['added'], $row['email'], $row['comment']); } } @@ -489,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=\"$PHP_SELF?id=$id&edit=1&delete_comment=$com_id\">[delete]</a>\n" : ''; + echo ($edit == 1 && $com_id !== 0 && in_array($user, $trusted_developers)) ? "<a href=\"" . $_SERVER['PHP_SELF'] . "?id=$id&edit=1&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=\"$PHP_SELF?id=\\2\">\\1</a>", $note); + echo preg_replace('/(bug\ *#([0-9]+))/i', "<a href=\"" . $_SERVER['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.18&r2=1.19&ty=u Index: php-bugs-web/bugstats.php diff -u php-bugs-web/bugstats.php:1.18 php-bugs-web/bugstats.php:1.19 --- php-bugs-web/bugstats.php:1.18 Mon Dec 8 11:56:57 2003 +++ php-bugs-web/bugstats.php Thu Jan 22 18:27:04 2004 @@ -1,17 +1,21 @@ <?php /* vim: set noet ts=4 sw=4: : */ - require_once 'prepend.inc'; commonHeader("Statistics"); -@mysql_connect("localhost","nobody","") - or die("unable to connect to database"); -@mysql_select_db("php3") +@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) or die("unable to select database"); $query = "SELECT status,bug_type,email,php_version,php_os FROM bugdb"; -if ($phpver > 0) { +// did we ask for a specific version ? +if (isset($_GET['phpver'])) { + $phpver = $_GET['phpver']; +} + +if (isset($phpver) && $phpver > 0) { $query .= " WHERE SUBSTRING(php_version,1,1) = '$phpver'"; } @@ -19,21 +23,27 @@ $result = mysql_unbuffered_query($query); -while ($row = mysql_fetch_array($result)) { - $bug_type['all'][$row[bug_type]]++; +$total = 0; + +while ($row = mysql_fetch_assoc($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 for this PHP version</p>'; + echo '<p>No bugs found'; + if (isset($phpver)) { + echo ' for this PHP version'; + } + echo '</p>'; commonFooter(); exit; } @@ -158,7 +168,7 @@ $query .= " AND SUBSTRING(php_version,1,1) = '$phpver'"; } $res = mysql_query($query); -$row = mysql_fetch_array($res); +$row = mysql_fetch_assoc($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.13&r2=1.14&ty=u Index: php-bugs-web/fix.php diff -u php-bugs-web/fix.php:1.13 php-bugs-web/fix.php:1.14 --- php-bugs-web/fix.php:1.13 Wed Dec 31 08:22:03 2003 +++ php-bugs-web/fix.php Thu Jan 22 18:27:04 2004 @@ -39,7 +39,7 @@ commonHeader("Resolve Bug"); display_errors($errors); ?> -<form method="post" action="<?php echo $PHP_SELF?>"> +<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="hidden" name="id" value="<?php echo $id?>" /> <table> <tr> @@ -70,9 +70,9 @@ exit; } -@mysql_connect("localhost","nobody","") +@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server."); -@mysql_select_db("php3"); +@mysql_select_db(BUG_DB_NAME); # fetch info about the bug into $bug $query = "SELECT id,bug_type,email,passwd,sdesc,ldesc," @@ -82,7 +82,7 @@ $res = mysql_query($query); -if ($res) $bug = mysql_fetch_array($res,MYSQL_ASSOC); +if ($res) $bug = mysql_fetch_assoc($res); 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.8&r2=1.9&ty=u Index: php-bugs-web/lbugs.php diff -u php-bugs-web/lbugs.php:1.8 php-bugs-web/lbugs.php:1.9 --- php-bugs-web/lbugs.php:1.8 Mon Dec 8 11:56:57 2003 +++ php-bugs-web/lbugs.php Thu Jan 22 18:27:04 2004 @@ -1,14 +1,14 @@ <?php /* vim: set noet ts=4 sw=4: : */ -mysql_connect("localhost","nobody","") +mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server\n"); -mysql_select_db("php3"); +mysql_select_db(BUG_DB_NAME); 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_array($result); + $row = mysql_fetch_assoc($result); echo "<pre><h1>Bug $id</h1>\n"; echo "<b>From : " . htmlspecialchars($row['email']) . "\n"; echo "Date : " . $row['ts1'] . "\n"; @@ -20,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_array($comresult)) { + while ($com = mysql_fetch_assoc($comresult)) { echo "<b><i>[",$com['ts'],"] ",$com['email'],"</i></b><br>\n"; $text = addlinks($com['comment']); echo "<blockquote>",$text,"</blockquote>\n"; @@ -37,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_array($result,MYSQL_ASSOC)) { + while ($row = mysql_fetch_assoc($result)) { if ($last_group != $row[bug_type]) { $last_group = $row[bug_type]; echo "===============================================[<b>".$row[bug_type]."]"; @@ -46,7 +46,7 @@ for($i=0;$i<$len; $i++) $s.= "="; echo "$s</b>\n"; } - printf("<a href=\"%s?id=%d\">%4d</a>",$PHP_SELF,$row[id],$row[id]); + printf("<a href=\"%s?id=%d\">%4d</a>", $_SERVER['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.13&r2=1.14&ty=u Index: php-bugs-web/lstats.php diff -u php-bugs-web/lstats.php:1.13 php-bugs-web/lstats.php:1.14 --- php-bugs-web/lstats.php:1.13 Mon Jan 19 12:19:39 2004 +++ php-bugs-web/lstats.php Thu Jan 22 18:27:04 2004 @@ -11,7 +11,7 @@ { global $phpver; - $query = "SELECT count(id) from bugdb WHERE"; + $query = "SELECT count(id) AS total from bugdb WHERE"; if ($phpver > 0) { $query .= " php_version LIKE '" . $phpver . "%' AND"; @@ -28,9 +28,9 @@ $query.= "AND bug_type NOT IN($excluded)"; $result=mysql_unbuffered_query($query); - $row=mysql_fetch_row($result); + $row=mysql_fetch_assoc($result); mysql_freeresult($result); - return $row[0]; + return $row['total']; } $statuses = array ( @@ -52,8 +52,8 @@ echo "<h3>Bug stats for PHP $phpver:</h3>\n<pre>\n"; } -mysql_connect("localhost","nobody",""); -mysql_select_db("php3"); +mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS); +mysql_select_db(BUG_DB_NAME); if (isset($per_category)) { include ('bugtypes.inc'); http://cvs.php.net/diff.php/php-bugs-web/report.php?r1=1.46&r2=1.47&ty=u Index: php-bugs-web/report.php diff -u php-bugs-web/report.php:1.46 php-bugs-web/report.php:1.47 --- php-bugs-web/report.php:1.46 Mon Jan 19 10:27:49 2004 +++ php-bugs-web/report.php Thu Jan 22 18:27:04 2004 @@ -17,13 +17,18 @@ $mail_bugs_to = "php-bugs@lists.php.net"; -@mysql_connect("localhost","nobody","") +@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server."); -@mysql_select_db("php3"); +@mysql_select_db(BUG_DB_NAME); + +if (isset($_POST['in'])) { + $in = $_POST['in']; +} + $errors = array(); -if ($in) { - if (!($errors = incoming_details_are_valid($_POST['in'], 1))) { +if (isset($in) && $in) { + if (!($errors = incoming_details_are_valid($in, 1))) { if (!$in['did_luser_search']) { @@ -72,7 +77,7 @@ </tr> <?php - while ($row = mysql_fetch_array($res)) { + while ($row = mysql_fetch_assoc($res)) { $resolution = mysql_get_one("SELECT comment from bugdb_comments where bug = " . $row['id'] . " order by id desc limit 1"); @@ -231,8 +236,25 @@ } 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 $PHP_SELF;?>"> +<form method="post" action="<?php echo $_SERVER['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.53&r2=1.54&ty=u Index: php-bugs-web/search.php diff -u php-bugs-web/search.php:1.53 php-bugs-web/search.php:1.54 --- php-bugs-web/search.php:1.53 Mon Dec 8 11:56:57 2003 +++ php-bugs-web/search.php Thu Jan 22 18:27:04 2004 @@ -5,7 +5,7 @@ list($user,$pw) = explode(":", base64_decode($MAGIC_COOKIE)); } -if ($search_for && !preg_match("/\\D/",trim($search_for))) { +if (isset($search_for) && !preg_match("/\\D/",trim($search_for))) { $x = $pw ? ($user ? "&edit=1" : "&edit=2") : ""; header("Location: bug.php?id=$search_for$x"); exit; @@ -19,9 +19,9 @@ define('BOOLEAN_SEARCH', @intval($boolean)); if (isset($cmd) && $cmd == "display") { - @mysql_connect("localhost","nobody","") + @mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server."); - @mysql_select_db("php3"); + @mysql_select_db(BUG_DB_NAME); $mysql4 = version_compare(mysql_get_server_info(), "4.0.0", "ge"); @@ -103,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 ($direction != "DESC") $direction = "ASC"; + if (isset($direction) && $direction != "DESC") $direction = "ASC"; if ($reorder_by) { if ($order_by == $reorder_by) { @@ -155,7 +155,7 @@ } } - $link = "$PHP_SELF?cmd=display" . + $link = $_SERVER['PHP_SELF'] . "?cmd=display" . $bug_type_string . $bug_ntype_string . "&status=" . urlencode(stripslashes($status)) . @@ -179,25 +179,25 @@ </tr> <?php if ($warnings) display_warnings($warnings); - while ($row = mysql_fetch_array($res)) { + while ($row = mysql_fetch_assoc($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]&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'] . "&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]) : " ", "</td>"; - echo "<td>", $row[sdesc] ? htmlspecialchars($row[sdesc]) : " ", "</td>"; - echo "<td>", $row[assign] ? htmlspecialchars($row[assign]) : " ", "</td>"; + echo "<td>", htmlspecialchars($row['php_version']), "</td>"; + echo "<td>", $row['php_os'] ? htmlspecialchars($row['php_os']) : " ", "</td>"; + echo "<td>", $row['sdesc'] ? htmlspecialchars($row['sdesc']) : " ", "</td>"; + echo "<td>", $row['assign'] ? htmlspecialchars($row['assign']) : " ", "</td>"; echo "</tr>\n"; } @@ -214,21 +214,21 @@ if ($errors) display_errors($errors); if ($warnings) display_warnings($warnings); ?> -<form id="asearch" method="get" action="<?php echo $PHP_SELF?>"> +<form id="asearch" method="get" action="<?php echo $_SERVER['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 echo htmlspecialchars(stripslashes($search_for));?>" size="20" maxlength="255" /> + <td><input type="text" name="search_for" value="<?php if (isset($search_for)) 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($direction != "DESC") { echo('checked="checked"'); }?>/>Ascending + <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="DESC" <?php if($direction == "DESC") { echo('checked="checked"'); }?>/>Descending + <input type="radio" name="direction" value="DESC" <?php if(isset($direction) && $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.3&r2=1.4&ty=u Index: php-bugs-web/source.php diff -u php-bugs-web/source.php:1.3 php-bugs-web/source.php:1.4 --- php-bugs-web/source.php:1.3 Tue Nov 26 15:41:48 2002 +++ php-bugs-web/source.php Thu Jan 22 18:27:04 2004 @@ -8,17 +8,15 @@ 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]) { @@ -42,12 +40,11 @@ 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 -<? print_link("/source.php?url=/include/layout.inc", "layout.inc"); ?> files. +<?php 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 -<? print_link("/source.php?url=/source.php", "here"); ?>. +<?php print_link("/source.php?url=/source.php", "here"); ?>. </P> -<? - -commonFooter(); +<?php + commonFooter(); ?> http://cvs.php.net/diff.php/php-bugs-web/vote.php?r1=1.6&r2=1.7&ty=u Index: php-bugs-web/vote.php diff -u php-bugs-web/vote.php:1.6 php-bugs-web/vote.php:1.7 --- php-bugs-web/vote.php:1.6 Mon Dec 8 11:56:57 2003 +++ php-bugs-web/vote.php Thu Jan 22 18:27:04 2004 @@ -17,9 +17,9 @@ $samever = (int)$samever; $sameos = (int)$sameos; -@mysql_connect("localhost","nobody","") +@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server."); -@mysql_select_db("php3"); +@mysql_select_db(BUG_DB_NAME); $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.108&r2=1.109&ty=u Index: php-bugs-web/include/functions.inc diff -u php-bugs-web/include/functions.inc:1.108 php-bugs-web/include/functions.inc:1.109 --- php-bugs-web/include/functions.inc:1.108 Mon Jan 19 10:01:26 2004 +++ php-bugs-web/include/functions.inc Thu Jan 22 18:27:04 2004 @@ -125,7 +125,7 @@ echo "<option", ($current == $v ? " selected" : ""), ">$v</option>\n"; if ($current == $v) $use++; } - if (!$use && $current) echo "<option selected>$current</option>\n"; + if (!isset($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 (!$use && $current && !is_array ($current)) { + if (!isset($use) && $current && !is_array ($current)) { echo "<option selected>$current</option>\n"; } } @@ -397,14 +397,16 @@ 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) { @@ -412,16 +414,16 @@ if (!$row) return ""; } - 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"; + 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"; } 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_row($res); + $row = mysql_fetch_assoc($res); if (!$row) return $output; - return ("\n\nPrevious Comments:\n$divider\n\n" . $output . "[$row[0]] ". spam_protect($row[1]) ."\n\n$row[2]\n\n$divider\n\n"); + return ("\n\nPrevious Comments:\n$divider\n\n" . $output . "[" . $row['ts1'] . "] ". spam_protect($row['email']) ."\n\n" . $row['ldesc'] . "\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.20&r2=1.21&ty=u Index: php-bugs-web/include/layout.inc diff -u php-bugs-web/include/layout.inc:1.20 php-bugs-web/include/layout.inc:1.21 --- php-bugs-web/include/layout.inc:1.20 Wed Dec 31 17:56:04 2003 +++ php-bugs-web/include/layout.inc Thu Jan 22 18:27:04 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{0} != "/") { - $dir = "/$dir"; - } + if (is_string($dir)) { + $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"><? - print_link('/source.php?url='.$HTTP_SERVER_VARS['SCRIPT_NAME'], 'show source', false, 'class="menuWhite"'); + <td align="right" valign="bottom"><?php + print_link('source.php?url='.$HTTP_SERVER_VARS['SCRIPT_NAME'], 'show source', false, 'class="menuWhite"'); ?> <br> </td> </tr> http://cvs.php.net/diff.php/php-bugs-web/rss/bug.php?r1=1.2&r2=1.3&ty=u Index: php-bugs-web/rss/bug.php diff -u php-bugs-web/rss/bug.php:1.2 php-bugs-web/rss/bug.php:1.3 --- php-bugs-web/rss/bug.php:1.2 Mon Dec 8 11:57:04 2003 +++ php-bugs-web/rss/bug.php Thu Jan 22 18:27:05 2004 @@ -10,9 +10,9 @@ $id = (int)$_REQUEST['id']; $format = $_REQUEST['format']; -@mysql_connect("localhost","nobody","") +@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server."); -@mysql_select_db("php3"); +@mysql_select_db(BUG_DB_NAME); $query = "SELECT id,bug_type,email,sdesc,ldesc," . "php_version,php_os,status,ts1 as ts_submitted,ts2 as ts_modified,assign," @@ -26,7 +26,7 @@ $res = @mysql_query($query); -if ($res) $bug = mysql_fetch_array($res,MYSQL_ASSOC); +if ($res) $bug = mysql_fetch_assoc($res); if (!$res || !$bug) { outputHeader(array(),$format); outputFooter($format); @@ -74,7 +74,7 @@ } function outputbug($bug, $res, $format) { - while ($row = mysql_fetch_array($res,MYSQL_ASSOC)) { + while ($row = mysql_fetch_assoc($res)) { switch ($format) { case 'xml': echo " <comment>\n"; http://cvs.php.net/diff.php/php-bugs-web/scripts/email-bug-summaries?r1=1.4&r2=1.5&ty=u Index: php-bugs-web/scripts/email-bug-summaries diff -u php-bugs-web/scripts/email-bug-summaries:1.4 php-bugs-web/scripts/email-bug-summaries:1.5 --- php-bugs-web/scripts/email-bug-summaries:1.4 Sun Mar 23 11:50:42 2003 +++ php-bugs-web/scripts/email-bug-summaries Thu Jan 22 18:27:06 2004 @@ -1,13 +1,13 @@ #!/usr/local/bin/php -q -<? - mysql_connect("localhost","nobody","") or die("Unable to connect to SQL server\n"); - mysql_select_db("php3"); +<?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); $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_array($result,MYSQL_ASSOC)) { + while($row = mysql_fetch_assoc($result)) { 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.4&r2=1.5&ty=u Index: php-bugs-web/scripts/no-feedback diff -u php-bugs-web/scripts/no-feedback:1.4 php-bugs-web/scripts/no-feedback:1.5 --- php-bugs-web/scripts/no-feedback:1.4 Mon Oct 14 20:23:24 2002 +++ php-bugs-web/scripts/no-feedback Thu Jan 22 18:27:06 2004 @@ -16,9 +16,9 @@ $mail_bugs_to = 'php-bugs@lists.php.net'; -mysql_connect("localhost", "nobody", "") +mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("unable to connect to database"); -mysql_select_db("php3") +mysql_select_db(BUG_DB_NAME) or die("unable to select db"); # fetch info about the bug into $bug @@ -38,7 +38,7 @@ $in = array('status' => 'No Feedback'); -while ($bug = mysql_fetch_array($result,MYSQL_ASSOC)) { +while ($bug = mysql_fetch_assoc($result)) { 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)."'"); http://cvs.php.net/co.php/php-bugs-web/include/config.php?r=1.1&p=1 Index: php-bugs-web/include/config.php +++ php-bugs-web/include/config.php <?php /** * Database configuration **/ define('BUG_DB_NAME', 'php3'); define('BUG_DB_SERVER', 'localhost'); define('BUG_DB_USER', 'nobody'); define('BUG_DB_PASS', '');
http://cvs.php.net/diff.php/php-bugs-web/.htaccess?r1=1.1&r2=1.2&ty=u Index: php-bugs-web/.htaccess diff -u php-bugs-web/.htaccess:1.1 php-bugs-web/.htaccess:1.2 --- php-bugs-web/.htaccess:1.1 Mon Feb 17 17:58:12 2003 +++ php-bugs-web/.htaccess Thu Jan 22 18:27:03 2004 @@ -4,3 +4,5 @@ php_value register_globals 1 php_value magic_quotes_gpc 1 php_value magic_quotes_runtime 0 +php_value include_path ".:./include" +php_value auto_prepend_file "include/config.php" http://cvs.php.net/diff.php/php-bugs-web/bug-pwd-finder.php?r1=1.7&r2=1.8&ty=u Index: php-bugs-web/bug-pwd-finder.php diff -u php-bugs-web/bug-pwd-finder.php:1.7 php-bugs-web/bug-pwd-finder.php:1.8 --- php-bugs-web/bug-pwd-finder.php:1.7 Mon Dec 8 11:56:57 2003 +++ php-bugs-web/bug-pwd-finder.php Thu Jan 22 18:27:04 2004 @@ -5,10 +5,10 @@ if ($bug_id) { - mysql_connect ("localhost","nobody","") + mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server. Please try again later."); - mysql_select_db ("php3"); + mysql_select_db(BUG_DB_NAME); // Clean up the bug id $bug_id = ereg_replace ("[^0-9]+", "", $bug_id); @@ -63,7 +63,7 @@ <?php if ($msg) { echo "<p><font color=\"#cc0000\">$msg</font></p>"; } ?> -<form method="post" action="<?php echo $PHP_SELF;?>"> +<form method="post" action="<?php echo $_SERVER['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.58&r2=1.59&ty=u Index: php-bugs-web/bug.php diff -u php-bugs-web/bug.php:1.58 php-bugs-web/bug.php:1.59 --- php-bugs-web/bug.php:1.58 Fri Jan 2 11:49:05 2004 +++ php-bugs-web/bug.php Thu Jan 22 18:27:04 2004 @@ -22,9 +22,9 @@ list($user,$pw) = explode(":", base64_decode($MAGIC_COOKIE)); } -@mysql_connect("localhost","nobody","") +@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server."); -@mysql_select_db("php3"); +@mysql_select_db(BUG_DB_NAME); # fetch info about the bug into $bug $query = "SELECT id,bug_type,email,passwd,sdesc,ldesc," @@ -39,7 +39,7 @@ $res = mysql_query($query); -if ($res) $bug = mysql_fetch_array($res,MYSQL_ASSOC); +if ($res) $bug = mysql_fetch_assoc($res); if (!$res || !$bug) { commonHeader("No such bug."); echo "<h1 class=\"error\">No such bug #$id!</h1>"; @@ -54,7 +54,7 @@ delete_comment($id, $delete_comment); $addon = '&thanks=1'; } - header("Location: $PHP_SELF?id=$id&edit=1$addon"); + header("Location: " . $_SERVER['PHP_SELF'] . "?id=$id&edit=1$addon"); exit(); } @@ -69,7 +69,7 @@ # Don't allow comments by the original report submitter if (stripslashes($in['commentemail']) == $bug['email']) { - header("Location: $PHP_SELF?id=$id&edit=2"); + header("Location: " . $_SERVER['PHP_SELF'] . "?id=$id&edit=2"); exit(); } @@ -88,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."; } @@ -117,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 */ @@ -174,7 +174,7 @@ if ($in && !$errors && $success) { mail_bug_updates($bug,$in,$from,$ncomment,$edit); - header("Location: $PHP_SELF?id=$id&thanks=$edit"); + header("Location: " . $_SERVER['PHP_SELF'] . "?id=$id&thanks=$edit"); exit; } @@ -250,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=\"$PHP_SELF?id=$GLOBALS[id]".($num ? "&edit=$num" : "")."\">" : "", - $desc, !$active ? "</a>" : "", "</span> "; + !$active ? "<a href=\"" . $_SERVER['PHP_SELF'] . "?id=" . $GLOBALS['id'] . ($num ? "&edit=$num" : "")."\">" : "", + $desc, !$active ? "</a>" : "", "</span>"; } control(0,'View/Vote'); @@ -278,7 +278,7 @@ } if ($edit == 1 || $edit == 2) {?> -<form id="update" action="<?php echo $PHP_SELF?>" method="post"> +<form id="update" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <?php if ($edit == 2) { if (!$in && $pw && $bug['passwd'] && stripslashes($pw)==$bug['passwd']) {?> @@ -293,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 "$PHP_SELF?id=$id&edit=3"?>">add a comment by following +href="<?php echo $_SERVER['PHP_SELF'] . "?id=$id&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>. @@ -327,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 "$PHP_SELF?id=$id&edit=3"?>">add a comment by following +<a href="<?php echo $_SERVER['PHP_SELF'] . "?id=$id&edit=3"; ?>">add a comment by following this link</a> or if you reported this bug, you can <a href="<?php echo -"$PHP_SELF?id=$id&edit=2"?>">edit this bug over here</a>. +$_SERVER['PHP_SELF'] . "?id=$id&edit=2"?>">edit this bug over here</a>. <?php }?> <table> <tr> @@ -396,13 +396,13 @@ </form> <?php }?> <?php if ($edit == 3) {?> -<form id="comment" action="<?php echo $PHP_SELF?>" method="post"> +<form id="comment" action="<?php echo $_SERVER['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 " — but make sure to <a href=\"$PHP_SELF?id=$id\">vote on the bug</a>"; } ?>! +<?php if (canvote()) { echo " — but make sure to <a href=\"" . $_SERVER['PHP_SELF'] . "?id=$id\">vote on the bug</a>"; } ?>! </div> <?php }?> <table> @@ -476,7 +476,7 @@ . " FROM bugdb_comments WHERE bug=$id ORDER BY ts"; $res = @mysql_query($query); if ($res) { - while ($row = mysql_fetch_array($res,MYSQL_ASSOC)) { + while ($row = mysql_fetch_assoc($res)) { output_note($row['id'], $row['added'], $row['email'], $row['comment']); } } @@ -489,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=\"$PHP_SELF?id=$id&edit=1&delete_comment=$com_id\">[delete]</a>\n" : ''; + echo ($edit == 1 && $com_id !== 0 && in_array($user, $trusted_developers)) ? "<a href=\"" . $_SERVER['PHP_SELF'] . "?id=$id&edit=1&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=\"$PHP_SELF?id=\\2\">\\1</a>", $note); + echo preg_replace('/(bug\ *#([0-9]+))/i', "<a href=\"" . $_SERVER['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.18&r2=1.19&ty=u Index: php-bugs-web/bugstats.php diff -u php-bugs-web/bugstats.php:1.18 php-bugs-web/bugstats.php:1.19 --- php-bugs-web/bugstats.php:1.18 Mon Dec 8 11:56:57 2003 +++ php-bugs-web/bugstats.php Thu Jan 22 18:27:04 2004 @@ -1,17 +1,21 @@ <?php /* vim: set noet ts=4 sw=4: : */ - require_once 'prepend.inc'; commonHeader("Statistics"); -@mysql_connect("localhost","nobody","") - or die("unable to connect to database"); -@mysql_select_db("php3") +@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) or die("unable to select database"); $query = "SELECT status,bug_type,email,php_version,php_os FROM bugdb"; -if ($phpver > 0) { +// did we ask for a specific version ? +if (isset($_GET['phpver'])) { + $phpver = $_GET['phpver']; +} + +if (isset($phpver) && $phpver > 0) { $query .= " WHERE SUBSTRING(php_version,1,1) = '$phpver'"; } @@ -19,21 +23,27 @@ $result = mysql_unbuffered_query($query); -while ($row = mysql_fetch_array($result)) { - $bug_type['all'][$row[bug_type]]++; +$total = 0; + +while ($row = mysql_fetch_assoc($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 for this PHP version</p>'; + echo '<p>No bugs found'; + if (isset($phpver)) { + echo ' for this PHP version'; + } + echo '</p>'; commonFooter(); exit; } @@ -158,7 +168,7 @@ $query .= " AND SUBSTRING(php_version,1,1) = '$phpver'"; } $res = mysql_query($query); -$row = mysql_fetch_array($res); +$row = mysql_fetch_assoc($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.13&r2=1.14&ty=u Index: php-bugs-web/fix.php diff -u php-bugs-web/fix.php:1.13 php-bugs-web/fix.php:1.14 --- php-bugs-web/fix.php:1.13 Wed Dec 31 08:22:03 2003 +++ php-bugs-web/fix.php Thu Jan 22 18:27:04 2004 @@ -39,7 +39,7 @@ commonHeader("Resolve Bug"); display_errors($errors); ?> -<form method="post" action="<?php echo $PHP_SELF?>"> +<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="hidden" name="id" value="<?php echo $id?>" /> <table> <tr> @@ -70,9 +70,9 @@ exit; } -@mysql_connect("localhost","nobody","") +@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server."); -@mysql_select_db("php3"); +@mysql_select_db(BUG_DB_NAME); # fetch info about the bug into $bug $query = "SELECT id,bug_type,email,passwd,sdesc,ldesc," @@ -82,7 +82,7 @@ $res = mysql_query($query); -if ($res) $bug = mysql_fetch_array($res,MYSQL_ASSOC); +if ($res) $bug = mysql_fetch_assoc($res); 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.8&r2=1.9&ty=u Index: php-bugs-web/lbugs.php diff -u php-bugs-web/lbugs.php:1.8 php-bugs-web/lbugs.php:1.9 --- php-bugs-web/lbugs.php:1.8 Mon Dec 8 11:56:57 2003 +++ php-bugs-web/lbugs.php Thu Jan 22 18:27:04 2004 @@ -1,14 +1,14 @@ <?php /* vim: set noet ts=4 sw=4: : */ -mysql_connect("localhost","nobody","") +mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server\n"); -mysql_select_db("php3"); +mysql_select_db(BUG_DB_NAME); 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_array($result); + $row = mysql_fetch_assoc($result); echo "<pre><h1>Bug $id</h1>\n"; echo "<b>From : " . htmlspecialchars($row['email']) . "\n"; echo "Date : " . $row['ts1'] . "\n"; @@ -20,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_array($comresult)) { + while ($com = mysql_fetch_assoc($comresult)) { echo "<b><i>[",$com['ts'],"] ",$com['email'],"</i></b><br>\n"; $text = addlinks($com['comment']); echo "<blockquote>",$text,"</blockquote>\n"; @@ -37,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_array($result,MYSQL_ASSOC)) { + while ($row = mysql_fetch_assoc($result)) { if ($last_group != $row[bug_type]) { $last_group = $row[bug_type]; echo "===============================================[<b>".$row[bug_type]."]"; @@ -46,7 +46,7 @@ for($i=0;$i<$len; $i++) $s.= "="; echo "$s</b>\n"; } - printf("<a href=\"%s?id=%d\">%4d</a>",$PHP_SELF,$row[id],$row[id]); + printf("<a href=\"%s?id=%d\">%4d</a>", $_SERVER['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.13&r2=1.14&ty=u Index: php-bugs-web/lstats.php diff -u php-bugs-web/lstats.php:1.13 php-bugs-web/lstats.php:1.14 --- php-bugs-web/lstats.php:1.13 Mon Jan 19 12:19:39 2004 +++ php-bugs-web/lstats.php Thu Jan 22 18:27:04 2004 @@ -11,7 +11,7 @@ { global $phpver; - $query = "SELECT count(id) from bugdb WHERE"; + $query = "SELECT count(id) AS total from bugdb WHERE"; if ($phpver > 0) { $query .= " php_version LIKE '" . $phpver . "%' AND"; @@ -28,9 +28,9 @@ $query.= "AND bug_type NOT IN($excluded)"; $result=mysql_unbuffered_query($query); - $row=mysql_fetch_row($result); + $row=mysql_fetch_assoc($result); mysql_freeresult($result); - return $row[0]; + return $row['total']; } $statuses = array ( @@ -52,8 +52,8 @@ echo "<h3>Bug stats for PHP $phpver:</h3>\n<pre>\n"; } -mysql_connect("localhost","nobody",""); -mysql_select_db("php3"); +mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS); +mysql_select_db(BUG_DB_NAME); if (isset($per_category)) { include ('bugtypes.inc'); http://cvs.php.net/diff.php/php-bugs-web/report.php?r1=1.46&r2=1.47&ty=u Index: php-bugs-web/report.php diff -u php-bugs-web/report.php:1.46 php-bugs-web/report.php:1.47 --- php-bugs-web/report.php:1.46 Mon Jan 19 10:27:49 2004 +++ php-bugs-web/report.php Thu Jan 22 18:27:04 2004 @@ -17,13 +17,18 @@ $mail_bugs_to = "php-bugs@lists.php.net"; -@mysql_connect("localhost","nobody","") +@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server."); -@mysql_select_db("php3"); +@mysql_select_db(BUG_DB_NAME); + +if (isset($_POST['in'])) { + $in = $_POST['in']; +} + $errors = array(); -if ($in) { - if (!($errors = incoming_details_are_valid($_POST['in'], 1))) { +if (isset($in) && $in) { + if (!($errors = incoming_details_are_valid($in, 1))) { if (!$in['did_luser_search']) { @@ -72,7 +77,7 @@ </tr> <?php - while ($row = mysql_fetch_array($res)) { + while ($row = mysql_fetch_assoc($res)) { $resolution = mysql_get_one("SELECT comment from bugdb_comments where bug = " . $row['id'] . " order by id desc limit 1"); @@ -231,8 +236,25 @@ } 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 $PHP_SELF;?>"> +<form method="post" action="<?php echo $_SERVER['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.53&r2=1.54&ty=u Index: php-bugs-web/search.php diff -u php-bugs-web/search.php:1.53 php-bugs-web/search.php:1.54 --- php-bugs-web/search.php:1.53 Mon Dec 8 11:56:57 2003 +++ php-bugs-web/search.php Thu Jan 22 18:27:04 2004 @@ -5,7 +5,7 @@ list($user,$pw) = explode(":", base64_decode($MAGIC_COOKIE)); } -if ($search_for && !preg_match("/\\D/",trim($search_for))) { +if (isset($search_for) && !preg_match("/\\D/",trim($search_for))) { $x = $pw ? ($user ? "&edit=1" : "&edit=2") : ""; header("Location: bug.php?id=$search_for$x"); exit; @@ -19,9 +19,9 @@ define('BOOLEAN_SEARCH', @intval($boolean)); if (isset($cmd) && $cmd == "display") { - @mysql_connect("localhost","nobody","") + @mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server."); - @mysql_select_db("php3"); + @mysql_select_db(BUG_DB_NAME); $mysql4 = version_compare(mysql_get_server_info(), "4.0.0", "ge"); @@ -103,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 ($direction != "DESC") $direction = "ASC"; + if (isset($direction) && $direction != "DESC") $direction = "ASC"; if ($reorder_by) { if ($order_by == $reorder_by) { @@ -155,7 +155,7 @@ } } - $link = "$PHP_SELF?cmd=display" . + $link = $_SERVER['PHP_SELF'] . "?cmd=display" . $bug_type_string . $bug_ntype_string . "&status=" . urlencode(stripslashes($status)) . @@ -179,25 +179,25 @@ </tr> <?php if ($warnings) display_warnings($warnings); - while ($row = mysql_fetch_array($res)) { + while ($row = mysql_fetch_assoc($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]&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'] . "&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]) : " ", "</td>"; - echo "<td>", $row[sdesc] ? htmlspecialchars($row[sdesc]) : " ", "</td>"; - echo "<td>", $row[assign] ? htmlspecialchars($row[assign]) : " ", "</td>"; + echo "<td>", htmlspecialchars($row['php_version']), "</td>"; + echo "<td>", $row['php_os'] ? htmlspecialchars($row['php_os']) : " ", "</td>"; + echo "<td>", $row['sdesc'] ? htmlspecialchars($row['sdesc']) : " ", "</td>"; + echo "<td>", $row['assign'] ? htmlspecialchars($row['assign']) : " ", "</td>"; echo "</tr>\n"; } @@ -214,21 +214,21 @@ if ($errors) display_errors($errors); if ($warnings) display_warnings($warnings); ?> -<form id="asearch" method="get" action="<?php echo $PHP_SELF?>"> +<form id="asearch" method="get" action="<?php echo $_SERVER['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 echo htmlspecialchars(stripslashes($search_for));?>" size="20" maxlength="255" /> + <td><input type="text" name="search_for" value="<?php if (isset($search_for)) 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($direction != "DESC") { echo('checked="checked"'); }?>/>Ascending + <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="DESC" <?php if($direction == "DESC") { echo('checked="checked"'); }?>/>Descending + <input type="radio" name="direction" value="DESC" <?php if(isset($direction) && $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.3&r2=1.4&ty=u Index: php-bugs-web/source.php diff -u php-bugs-web/source.php:1.3 php-bugs-web/source.php:1.4 --- php-bugs-web/source.php:1.3 Tue Nov 26 15:41:48 2002 +++ php-bugs-web/source.php Thu Jan 22 18:27:04 2004 @@ -8,17 +8,15 @@ 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]) { @@ -42,12 +40,11 @@ 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 -<? print_link("/source.php?url=/include/layout.inc", "layout.inc"); ?> files. +<?php 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 -<? print_link("/source.php?url=/source.php", "here"); ?>. +<?php print_link("/source.php?url=/source.php", "here"); ?>. </P> -<? - -commonFooter(); +<?php + commonFooter(); ?> http://cvs.php.net/diff.php/php-bugs-web/vote.php?r1=1.6&r2=1.7&ty=u Index: php-bugs-web/vote.php diff -u php-bugs-web/vote.php:1.6 php-bugs-web/vote.php:1.7 --- php-bugs-web/vote.php:1.6 Mon Dec 8 11:56:57 2003 +++ php-bugs-web/vote.php Thu Jan 22 18:27:04 2004 @@ -17,9 +17,9 @@ $samever = (int)$samever; $sameos = (int)$sameos; -@mysql_connect("localhost","nobody","") +@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server."); -@mysql_select_db("php3"); +@mysql_select_db(BUG_DB_NAME); $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.108&r2=1.109&ty=u Index: php-bugs-web/include/functions.inc diff -u php-bugs-web/include/functions.inc:1.108 php-bugs-web/include/functions.inc:1.109 --- php-bugs-web/include/functions.inc:1.108 Mon Jan 19 10:01:26 2004 +++ php-bugs-web/include/functions.inc Thu Jan 22 18:27:04 2004 @@ -125,7 +125,7 @@ echo "<option", ($current == $v ? " selected" : ""), ">$v</option>\n"; if ($current == $v) $use++; } - if (!$use && $current) echo "<option selected>$current</option>\n"; + if (!isset($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 (!$use && $current && !is_array ($current)) { + if (!isset($use) && $current && !is_array ($current)) { echo "<option selected>$current</option>\n"; } } @@ -397,14 +397,16 @@ 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) { @@ -412,16 +414,16 @@ if (!$row) return ""; } - 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"; + 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"; } 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_row($res); + $row = mysql_fetch_assoc($res); if (!$row) return $output; - return ("\n\nPrevious Comments:\n$divider\n\n" . $output . "[$row[0]] ". spam_protect($row[1]) ."\n\n$row[2]\n\n$divider\n\n"); + return ("\n\nPrevious Comments:\n$divider\n\n" . $output . "[" . $row['ts1'] . "] ". spam_protect($row['email']) ."\n\n" . $row['ldesc'] . "\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.20&r2=1.21&ty=u Index: php-bugs-web/include/layout.inc diff -u php-bugs-web/include/layout.inc:1.20 php-bugs-web/include/layout.inc:1.21 --- php-bugs-web/include/layout.inc:1.20 Wed Dec 31 17:56:04 2003 +++ php-bugs-web/include/layout.inc Thu Jan 22 18:27:04 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{0} != "/") { - $dir = "/$dir"; - } + if (is_string($dir)) { + $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"><? - print_link('/source.php?url='.$HTTP_SERVER_VARS['SCRIPT_NAME'], 'show source', false, 'class="menuWhite"'); + <td align="right" valign="bottom"><?php + print_link('source.php?url='.$HTTP_SERVER_VARS['SCRIPT_NAME'], 'show source', false, 'class="menuWhite"'); ?> <br> </td> </tr> http://cvs.php.net/diff.php/php-bugs-web/rss/bug.php?r1=1.2&r2=1.3&ty=u Index: php-bugs-web/rss/bug.php diff -u php-bugs-web/rss/bug.php:1.2 php-bugs-web/rss/bug.php:1.3 --- php-bugs-web/rss/bug.php:1.2 Mon Dec 8 11:57:04 2003 +++ php-bugs-web/rss/bug.php Thu Jan 22 18:27:05 2004 @@ -10,9 +10,9 @@ $id = (int)$_REQUEST['id']; $format = $_REQUEST['format']; -@mysql_connect("localhost","nobody","") +@mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("Unable to connect to SQL server."); -@mysql_select_db("php3"); +@mysql_select_db(BUG_DB_NAME); $query = "SELECT id,bug_type,email,sdesc,ldesc," . "php_version,php_os,status,ts1 as ts_submitted,ts2 as ts_modified,assign," @@ -26,7 +26,7 @@ $res = @mysql_query($query); -if ($res) $bug = mysql_fetch_array($res,MYSQL_ASSOC); +if ($res) $bug = mysql_fetch_assoc($res); if (!$res || !$bug) { outputHeader(array(),$format); outputFooter($format); @@ -74,7 +74,7 @@ } function outputbug($bug, $res, $format) { - while ($row = mysql_fetch_array($res,MYSQL_ASSOC)) { + while ($row = mysql_fetch_assoc($res)) { switch ($format) { case 'xml': echo " <comment>\n"; http://cvs.php.net/diff.php/php-bugs-web/scripts/email-bug-summaries?r1=1.4&r2=1.5&ty=u Index: php-bugs-web/scripts/email-bug-summaries diff -u php-bugs-web/scripts/email-bug-summaries:1.4 php-bugs-web/scripts/email-bug-summaries:1.5 --- php-bugs-web/scripts/email-bug-summaries:1.4 Sun Mar 23 11:50:42 2003 +++ php-bugs-web/scripts/email-bug-summaries Thu Jan 22 18:27:06 2004 @@ -1,13 +1,13 @@ #!/usr/local/bin/php -q -<? - mysql_connect("localhost","nobody","") or die("Unable to connect to SQL server\n"); - mysql_select_db("php3"); +<?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); $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_array($result,MYSQL_ASSOC)) { + while($row = mysql_fetch_assoc($result)) { 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.4&r2=1.5&ty=u Index: php-bugs-web/scripts/no-feedback diff -u php-bugs-web/scripts/no-feedback:1.4 php-bugs-web/scripts/no-feedback:1.5 --- php-bugs-web/scripts/no-feedback:1.4 Mon Oct 14 20:23:24 2002 +++ php-bugs-web/scripts/no-feedback Thu Jan 22 18:27:06 2004 @@ -16,9 +16,9 @@ $mail_bugs_to = 'php-bugs@lists.php.net'; -mysql_connect("localhost", "nobody", "") +mysql_connect(BUG_DB_SERVER, BUG_DB_USER, BUG_DB_PASS) or die("unable to connect to database"); -mysql_select_db("php3") +mysql_select_db(BUG_DB_NAME) or die("unable to select db"); # fetch info about the bug into $bug @@ -38,7 +38,7 @@ $in = array('status' => 'No Feedback'); -while ($bug = mysql_fetch_array($result,MYSQL_ASSOC)) { +while ($bug = mysql_fetch_assoc($result)) { 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)."'"); http://cvs.php.net/co.php/php-bugs-web/include/config.php?r=1.1&p=1 Index: php-bugs-web/include/config.php +++ php-bugs-web/include/config.php <?php /** * Database configuration **/ define('BUG_DB_NAME', 'php3'); define('BUG_DB_SERVER', 'localhost'); define('BUG_DB_USER', 'nobody'); define('BUG_DB_PASS', '');