cvs: php-bugs-web / bug.php bugstats.php lbugs.php report.php search.php /include functions.inc
| From: | Mehdi Achour | Date: | Mon, 09 Feb 2004 16:28:22 +0000 |
| Subject: | cvs: php-bugs-web / bug.php bugstats.php lbugs.php report.php search.php /include functions.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-23392@lists.php.net to get a copy of this message | ||
didou Mon Feb 9 11:28:22 2004 EDT
Modified files:
/php-bugs-web bug.php bugstats.php lbugs.php report.php search.php
/php-bugs-web/include functions.inc
Log:
kill some E_NOTICEs
http://cvs.php.net/diff.php/php-bugs-web/bug.php?r1=1.62&r2=1.63&ty=u Index: php-bugs-web/bug.php diff -u php-bugs-web/bug.php:1.62 php-bugs-web/bug.php:1.63 --- php-bugs-web/bug.php:1.62 Mon Feb 9 08:23:47 2004 +++ php-bugs-web/bug.php Mon Feb 9 11:28:21 2004 @@ -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,11 +117,11 @@ } } - $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 */ - $query = "UPDATE bugdb SET sdesc='$in[sdesc]',status='$in[status]', bug_type='$in[bug_type]', php_version='$in[php_version]', php_os='$in[php_os]', ts2=NOW(), email='$from' WHERE id=$id"; + $query = "UPDATE bugdb SET sdesc='" . $in['sdesc'] . "',status='" . $in['status'] . "', bug_type='" . $in['bug_type'] . "', php_version='" . $in['php_version'] . "', php_os='" . $in['php_os'] . "', ts2=NOW(), email='$from' WHERE id=$id"; $success = @mysql_query($query); /* add comment */ @@ -142,7 +142,7 @@ $errors[] = "You must provide a comment when marking a bug 'Bogus'"; } elseif ($in['resolve']) { if (!$trytoforce && $RESOLVE_REASONS[$in['resolve']]['status'] == $bug['status']) { - $errors[] = "The bug is already marked '$bug[status]'. (Submit again to ignore this.)"; + $errors[] = "The bug is already marked '" . $bug['status'] . "'. (Submit again to ignore this.)"; } elseif (!$errors) { if ($in['status'] == $bug['status']) { @@ -160,7 +160,7 @@ if (!$errors && !($errors = incoming_details_are_valid($in))) { $query = 'UPDATE bugdb SET '; - $query.= ($bug[email] != $in[email] && !empty($in[email])) ? "email='$in[email]', " : ''; + $query.= ($bug['email'] != $in['email'] && !empty($in['email'])) ? "email='" . $in['email'] . "', " : ''; $query.= "sdesc='$in[sdesc]', status='$in[status]', bug_type='$in[bug_type]', assign='$in[assign]', php_version='$in[php_version]', php_os='$in[php_os]', ts2=NOW() WHERE id=$id"; $success = @mysql_query($query); if ($success && !empty($ncomment)) { http://cvs.php.net/diff.php/php-bugs-web/bugstats.php?r1=1.22&r2=1.23&ty=u Index: php-bugs-web/bugstats.php diff -u php-bugs-web/bugstats.php:1.22 php-bugs-web/bugstats.php:1.23 --- php-bugs-web/bugstats.php:1.22 Mon Feb 9 08:23:47 2004 +++ php-bugs-web/bugstats.php Mon Feb 9 11:28:21 2004 @@ -20,13 +20,13 @@ $result = mysql_unbuffered_query($query); while ($row = mysql_fetch_array($result)) { - $bug_type['all'][$row[bug_type]]++; + $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++; } @@ -171,10 +171,10 @@ echo "<p><b>Bug Report Time to Close Stats</b>\n"; echo "<table>\n"; -echo "<tr bgcolor=#aabbcc><th align=right>Average life of a report:</th><td bgcolor=#ccddee>",ShowTime((int)$row[average]),"</td></tr>\n"; +echo "<tr bgcolor=#aabbcc><th align=right>Average life of a report:</th><td bgcolor=#ccddee>",ShowTime((int)$row['average']),"</td></tr>\n"; echo "<tr bgcolor=#aabbcc><th align=right>Median life of a report:</th><td bgcolor=#ccddee>",ShowTime($median),"</td></tr>\n"; -echo "<tr bgcolor=#aabbcc><th align=right>Slowest report closure:</th><td bgcolor=#ccddee>",ShowTime($row[slowest]),"</td></tr>\n"; -echo "<tr bgcolor=#aabbcc><th align=right>Quickest report closure:</th><td bgcolor=#ccddee>",ShowTime($row[quickest]),"</td></tr>\n"; +echo "<tr bgcolor=#aabbcc><th align=right>Slowest report closure:</th><td bgcolor=#ccddee>",ShowTime($row['slowest']),"</td></tr>\n"; +echo "<tr bgcolor=#aabbcc><th align=right>Quickest report closure:</th><td bgcolor=#ccddee>",ShowTime($row['quickest']),"</td></tr>\n"; echo "</table>\n"; commonFooter(); http://cvs.php.net/diff.php/php-bugs-web/lbugs.php?r1=1.12&r2=1.13&ty=u Index: php-bugs-web/lbugs.php diff -u php-bugs-web/lbugs.php:1.12 php-bugs-web/lbugs.php:1.13 --- php-bugs-web/lbugs.php:1.12 Mon Feb 9 08:23:47 2004 +++ php-bugs-web/lbugs.php Mon Feb 9 11:28:21 2004 @@ -38,17 +38,17 @@ echo "<pre> Num Status Summary ($num total including feature requests)\n"; $last_group = ""; while ($row = mysql_fetch_assoc($result)) { - if ($last_group != $row[bug_type]) { - $last_group = $row[bug_type]; - echo "===============================================[<b>".$row[bug_type]."]"; - $len = 29-strlen($row[bug_type]); + if ($last_group != $row['bug_type']) { + $last_group = $row['bug_type']; + echo "===============================================[<b>".$row['bug_type']."]"; + $len = 29-strlen($row['bug_type']); $s=''; 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(" %-9s ",$row[status]); - echo " ".htmlspecialchars($row[sdesc])."\n"; + printf("<a href=\"%s?id=%d\">%4d</a>",$PHP_SELF,$row['id'],$row['id']); + printf(" %-9s ",$row['status']); + echo " ".htmlspecialchars($row['sdesc'])."\n"; } mysql_free_result($result); echo "</pre>"; http://cvs.php.net/diff.php/php-bugs-web/report.php?r1=1.51&r2=1.52&ty=u Index: php-bugs-web/report.php diff -u php-bugs-web/report.php:1.51 php-bugs-web/report.php:1.52 --- php-bugs-web/report.php:1.51 Mon Feb 9 08:23:47 2004 +++ php-bugs-web/report.php Mon Feb 9 11:28:21 2004 @@ -87,7 +87,7 @@ $summary = htmlspecialchars($summary); } - $bug_url = "/bug.php?id=$row[id]&edit=2"; + $bug_url = "/bug.php?id=" . $row['id'] . "&edit=2"; echo "<tr><td colspan=\"2\"><a href=\"$bug_url\">Bug #{$row['id']}: " , htmlspecialchars($row['sdesc']) , "</a></td></tr>"; echo "<tr><td>{$summary}</td>"; http://cvs.php.net/diff.php/php-bugs-web/search.php?r1=1.56&r2=1.57&ty=u Index: php-bugs-web/search.php diff -u php-bugs-web/search.php:1.56 php-bugs-web/search.php:1.57 --- php-bugs-web/search.php:1.56 Thu Jan 22 22:05:28 2004 +++ php-bugs-web/search.php Mon Feb 9 11:28:21 2004 @@ -187,17 +187,17 @@ 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"; } http://cvs.php.net/diff.php/php-bugs-web/include/functions.inc?r1=1.111&r2=1.112&ty=u Index: php-bugs-web/include/functions.inc diff -u php-bugs-web/include/functions.inc:1.111 php-bugs-web/include/functions.inc:1.112 --- php-bugs-web/include/functions.inc:1.111 Tue Feb 3 10:04:53 2004 +++ php-bugs-web/include/functions.inc Mon Feb 9 11:28:22 2004 @@ -317,7 +317,7 @@ "http://bugs.php.net/?id=$bug[id]&edit=1\n"; /* send mail if status was changed or there is a comment */ - if ($in[status] != $bug[status] || $ncomment != "") { + if ($in['status'] != $bug['status'] || $ncomment != "") { $old_status = $bug['status']; $new_status = $bug['status']; @@ -332,7 +332,7 @@ } # the user gets sent mail with an envelope sender that ignores bounces - @mail($bug[email], + @mail($bug['email'], "Bug " . rinse($subj) . txfield('sdesc'), $user_text, "From: PHP Bug Database <$mailfrom>\n". @@ -445,7 +445,7 @@ global $bug; $errors = array(); - if ($initial || (!empty($in[email]) && $bug[email] != $in[email])) { + if ($initial || (!empty($in['email']) && $bug['email'] != $in['email'])) { if (!preg_match("/[.\\w+-]+@[.\\w-]+\\.\\w{2,}/i",$in['email'])) { $errors[] = "Please provide a valid email address."; }
http://cvs.php.net/diff.php/php-bugs-web/bug.php?r1=1.62&r2=1.63&ty=u Index: php-bugs-web/bug.php diff -u php-bugs-web/bug.php:1.62 php-bugs-web/bug.php:1.63 --- php-bugs-web/bug.php:1.62 Mon Feb 9 08:23:47 2004 +++ php-bugs-web/bug.php Mon Feb 9 11:28:21 2004 @@ -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,11 +117,11 @@ } } - $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 */ - $query = "UPDATE bugdb SET sdesc='$in[sdesc]',status='$in[status]', bug_type='$in[bug_type]', php_version='$in[php_version]', php_os='$in[php_os]', ts2=NOW(), email='$from' WHERE id=$id"; + $query = "UPDATE bugdb SET sdesc='" . $in['sdesc'] . "',status='" . $in['status'] . "', bug_type='" . $in['bug_type'] . "', php_version='" . $in['php_version'] . "', php_os='" . $in['php_os'] . "', ts2=NOW(), email='$from' WHERE id=$id"; $success = @mysql_query($query); /* add comment */ @@ -142,7 +142,7 @@ $errors[] = "You must provide a comment when marking a bug 'Bogus'"; } elseif ($in['resolve']) { if (!$trytoforce && $RESOLVE_REASONS[$in['resolve']]['status'] == $bug['status']) { - $errors[] = "The bug is already marked '$bug[status]'. (Submit again to ignore this.)"; + $errors[] = "The bug is already marked '" . $bug['status'] . "'. (Submit again to ignore this.)"; } elseif (!$errors) { if ($in['status'] == $bug['status']) { @@ -160,7 +160,7 @@ if (!$errors && !($errors = incoming_details_are_valid($in))) { $query = 'UPDATE bugdb SET '; - $query.= ($bug[email] != $in[email] && !empty($in[email])) ? "email='$in[email]', " : ''; + $query.= ($bug['email'] != $in['email'] && !empty($in['email'])) ? "email='" . $in['email'] . "', " : ''; $query.= "sdesc='$in[sdesc]', status='$in[status]', bug_type='$in[bug_type]', assign='$in[assign]', php_version='$in[php_version]', php_os='$in[php_os]', ts2=NOW() WHERE id=$id"; $success = @mysql_query($query); if ($success && !empty($ncomment)) { http://cvs.php.net/diff.php/php-bugs-web/bugstats.php?r1=1.22&r2=1.23&ty=u Index: php-bugs-web/bugstats.php diff -u php-bugs-web/bugstats.php:1.22 php-bugs-web/bugstats.php:1.23 --- php-bugs-web/bugstats.php:1.22 Mon Feb 9 08:23:47 2004 +++ php-bugs-web/bugstats.php Mon Feb 9 11:28:21 2004 @@ -20,13 +20,13 @@ $result = mysql_unbuffered_query($query); while ($row = mysql_fetch_array($result)) { - $bug_type['all'][$row[bug_type]]++; + $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++; } @@ -171,10 +171,10 @@ echo "<p><b>Bug Report Time to Close Stats</b>\n"; echo "<table>\n"; -echo "<tr bgcolor=#aabbcc><th align=right>Average life of a report:</th><td bgcolor=#ccddee>",ShowTime((int)$row[average]),"</td></tr>\n"; +echo "<tr bgcolor=#aabbcc><th align=right>Average life of a report:</th><td bgcolor=#ccddee>",ShowTime((int)$row['average']),"</td></tr>\n"; echo "<tr bgcolor=#aabbcc><th align=right>Median life of a report:</th><td bgcolor=#ccddee>",ShowTime($median),"</td></tr>\n"; -echo "<tr bgcolor=#aabbcc><th align=right>Slowest report closure:</th><td bgcolor=#ccddee>",ShowTime($row[slowest]),"</td></tr>\n"; -echo "<tr bgcolor=#aabbcc><th align=right>Quickest report closure:</th><td bgcolor=#ccddee>",ShowTime($row[quickest]),"</td></tr>\n"; +echo "<tr bgcolor=#aabbcc><th align=right>Slowest report closure:</th><td bgcolor=#ccddee>",ShowTime($row['slowest']),"</td></tr>\n"; +echo "<tr bgcolor=#aabbcc><th align=right>Quickest report closure:</th><td bgcolor=#ccddee>",ShowTime($row['quickest']),"</td></tr>\n"; echo "</table>\n"; commonFooter(); http://cvs.php.net/diff.php/php-bugs-web/lbugs.php?r1=1.12&r2=1.13&ty=u Index: php-bugs-web/lbugs.php diff -u php-bugs-web/lbugs.php:1.12 php-bugs-web/lbugs.php:1.13 --- php-bugs-web/lbugs.php:1.12 Mon Feb 9 08:23:47 2004 +++ php-bugs-web/lbugs.php Mon Feb 9 11:28:21 2004 @@ -38,17 +38,17 @@ echo "<pre> Num Status Summary ($num total including feature requests)\n"; $last_group = ""; while ($row = mysql_fetch_assoc($result)) { - if ($last_group != $row[bug_type]) { - $last_group = $row[bug_type]; - echo "===============================================[<b>".$row[bug_type]."]"; - $len = 29-strlen($row[bug_type]); + if ($last_group != $row['bug_type']) { + $last_group = $row['bug_type']; + echo "===============================================[<b>".$row['bug_type']."]"; + $len = 29-strlen($row['bug_type']); $s=''; 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(" %-9s ",$row[status]); - echo " ".htmlspecialchars($row[sdesc])."\n"; + printf("<a href=\"%s?id=%d\">%4d</a>",$PHP_SELF,$row['id'],$row['id']); + printf(" %-9s ",$row['status']); + echo " ".htmlspecialchars($row['sdesc'])."\n"; } mysql_free_result($result); echo "</pre>"; http://cvs.php.net/diff.php/php-bugs-web/report.php?r1=1.51&r2=1.52&ty=u Index: php-bugs-web/report.php diff -u php-bugs-web/report.php:1.51 php-bugs-web/report.php:1.52 --- php-bugs-web/report.php:1.51 Mon Feb 9 08:23:47 2004 +++ php-bugs-web/report.php Mon Feb 9 11:28:21 2004 @@ -87,7 +87,7 @@ $summary = htmlspecialchars($summary); } - $bug_url = "/bug.php?id=$row[id]&edit=2"; + $bug_url = "/bug.php?id=" . $row['id'] . "&edit=2"; echo "<tr><td colspan=\"2\"><a href=\"$bug_url\">Bug #{$row['id']}: " , htmlspecialchars($row['sdesc']) , "</a></td></tr>"; echo "<tr><td>{$summary}</td>"; http://cvs.php.net/diff.php/php-bugs-web/search.php?r1=1.56&r2=1.57&ty=u Index: php-bugs-web/search.php diff -u php-bugs-web/search.php:1.56 php-bugs-web/search.php:1.57 --- php-bugs-web/search.php:1.56 Thu Jan 22 22:05:28 2004 +++ php-bugs-web/search.php Mon Feb 9 11:28:21 2004 @@ -187,17 +187,17 @@ 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"; } http://cvs.php.net/diff.php/php-bugs-web/include/functions.inc?r1=1.111&r2=1.112&ty=u Index: php-bugs-web/include/functions.inc diff -u php-bugs-web/include/functions.inc:1.111 php-bugs-web/include/functions.inc:1.112 --- php-bugs-web/include/functions.inc:1.111 Tue Feb 3 10:04:53 2004 +++ php-bugs-web/include/functions.inc Mon Feb 9 11:28:22 2004 @@ -317,7 +317,7 @@ "http://bugs.php.net/?id=$bug[id]&edit=1\n"; /* send mail if status was changed or there is a comment */ - if ($in[status] != $bug[status] || $ncomment != "") { + if ($in['status'] != $bug['status'] || $ncomment != "") { $old_status = $bug['status']; $new_status = $bug['status']; @@ -332,7 +332,7 @@ } # the user gets sent mail with an envelope sender that ignores bounces - @mail($bug[email], + @mail($bug['email'], "Bug " . rinse($subj) . txfield('sdesc'), $user_text, "From: PHP Bug Database <$mailfrom>\n". @@ -445,7 +445,7 @@ global $bug; $errors = array(); - if ($initial || (!empty($in[email]) && $bug[email] != $in[email])) { + if ($initial || (!empty($in['email']) && $bug['email'] != $in['email'])) { if (!preg_match("/[.\\w+-]+@[.\\w-]+\\.\\w{2,}/i",$in['email'])) { $errors[] = "Please provide a valid email address."; }