\n"; ?>
bugs of type: reported since:
OS (substr search):
with text: in the report or email address max. entries / page.
bug number: Statistics
\n"; $report .= "From: $email\n"; $report .= "Operating system: $php_os\n"; $report .= "PHP version: $php_version\n"; $report .= "PHP Bug Type: $bug_type\n"; $report .= "Bug description: "; echo $report; echo htmlspecialchars($sdesc), "\n\n"; echo wordwrap(htmlspecialchars($ldesc)); echo "\n"; $ascii_report = "$report$sdesc\n\n".wordwrap($ldesc); $ascii_report.= "\n-- \nEdit bug report at: http://bugs.php.net/?id=$cid&edit=1\n"; list($mailto,$mailfrom) = get_bugtype_mail($bug_type); if (mail($mailto, "Bug #$cid: $sdesc", $ascii_report, "From: $email\nX-PHP-Bug: $cid\nMessage-ID: ")) { @mail($email, "Bug #$cid: $sdesc", $ascii_report, "From: PHP Bug Database <$mailfrom>\nX-PHP-Bug: $cid\nMessage-ID: "); echo "

Mail sent to $mailto...

\n"; echo "

Thank you for your help!

"; echo "

The password for this report is: ".htmlentities($passwd)."
"; echo "If the status of the bug report you submitted\n"; echo "changes, you will be notified. You may return here and check on the status\n"; echo "or update your report at any time. The URL for your bug report is: "; echo "http://bugs.php.net/?id=$cid

\n"; } else { echo "

Mail not sent!

\n"; echo "Please send this page in a mail to " . "$mailto manually.

\n"; } commonFooter(); exit; } } elseif ($cmd == "display") { if (!$bug_type) $bug_type = "Any"; $query = "SELECT *,TO_DAYS(NOW())-TO_DAYS(ts2) AS unchanged FROM bugdb "; if($bug_type=="Any") { $where_clause = "WHERE bug_type != 'Feature/Change Request'"; } else { $where_clause = "WHERE bug_type = '$bug_type'"; } /* Treat assigned, analyzed and critical bugs as open */ if ($status == "Open") { $where_clause .= " AND (status='Open' OR status='Assigned' OR status='Analyzed' OR status='Critical')"; } elseif ($status == "Old Feedback") { $where_clause .= " AND status='Feedback' AND TO_DAYS(NOW())-TO_DAYS(ts2)>60"; } elseif ($status == "Stale") { $where_clause .= " AND status != 'Closed' AND status != 'Duplicate' AND status != 'Bogus' AND TO_DAYS(NOW())-TO_DAYS(ts2) > 30"; } elseif ($status != "All") { $where_clause .= " AND status='$status'"; } if (strlen($search_for)) { $where_clause .= " AND (email like '%$search_for%' OR sdesc LIKE '%$search_for%' OR ldesc LIKE '%$search_for%')"; } if ($bug_age) { $where_clause .= " AND ts1 >= DATE_SUB(NOW(), INTERVAL $bug_age DAY)"; } if ($php_os) { $where_clause .= " AND php_os like '%$php_os%'"; } if (!isset($phpver)) $phpver = "4"; if ($phpver) $where_clause .= " AND SUBSTRING(php_version,1,1) = '$phpver'"; /* not in the header, but someone can build a query manually with it. */ if(strlen($by) and $by!='Any') $where_clause .= " AND dev_id = '$by' "; $query .= "$where_clause "; if (!$order_by) $order_by = "id"; if (!$direction) $direction = "ASC"; if ($reorder_by) { if ($order_by == $reorder_by) { $direction = $direction == "ASC" ? "DESC" : "ASC"; } else { $direction = "ASC"; } $order_by = $reorder_by; } $query .= " ORDER BY $order_by $direction"; if (!$begin) $begin = 0; if (!isset($limit)) $limit = 30; if($limit!='All') $query .= " LIMIT $begin,$limit"; $res = @mysql_query($query); if (!$res) die(htmlspecialchars($query)."
".mysql_error()); $rows = mysql_numrows($res); if (!$rows) { echo "

No bugs with the specified criteria were found.

"; } else { $link = "$PHP_SELF?cmd=display&bug_type=" . urlencode ($bug_type) . "&status=$status&search_for=".htmlspecialchars(stripslashes($search_for))."&php_os=".htmlspecialchars(stripslashes($php_os))."&bug_age=$bug_age&by=$by&order_by=$order_by&direction=$direction&phpver=$phpver&limit=$limit"; ?> '; echo ""; if ($bug_type == "Any") { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; } show_prev_next($begin,$rows,$link,$limit); ?>
ID# Type Status Version OS Description Mod Assigned
$row[id]", htmlspecialchars($row[bug_type]), "", htmlspecialchars($row[status]); if ($row[status] == "Feedback" && $row[unchanged] > 0) { printf ("
%d day%s", $row[unchanged], $row[unchanged] > 1 ? "s" : ""); } echo "
", htmlspecialchars($row[php_version]), "", $row[php_os] ? htmlspecialchars($row[php_os]) : " ", "", $row[sdesc] ? htmlspecialchars($row[sdesc]) : " ", "\"edit\"", $row[assign] ? htmlspecialchars($row[assign]) : " ", "
Submit a Bug Report

"; commonFooter(); exit; } elseif (!isset($cmd) && isset($id)) { # fetch the original bug into $original $res = mysql_query("SELECT * FROM bugdb WHERE id=$id"); if ($res) $original = mysql_fetch_array($res); if (!$res || !$original) { echo "

No such bug #$id!

"; commonFooter(); exit; } # handle any updates, displaying errors if there were any $success = 0; if ($modify == "user") { if (!$original[passwd] || $original[passwd] != stripslashes($pw)) { echo "

The password you supplied was incorrect.

\n"; } elseif (incoming_details_are_valid()) { /* update bug record */ $success = @mysql_query("UPDATE bugdb SET status='$status', bug_type='$bug_type', php_version='$php_version', php_os='$php_os', ts2=NOW(), email='$email' WHERE id=$id"); /* add comment */ if ($success && !empty($ncomment)) { $success = @mysql_query("INSERT INTO bugdb_comments (bug, email, ts, comment) VALUES ($id,'$email',NOW(),'$ncomment')"); } } $from = $email; } elseif ($modify == "developer") { if (!verify_password($user,$pw)) { echo "

The username or password you supplied was incorrect.

\n"; } elseif (incoming_details_are_valid()) { $success = @mysql_query("UPDATE bugdb SET sdesc='$sdesc',status='$status', bug_type='$bug_type', assign='$assign', dev_id='$user', php_version='$php_version', php_os='$php_os', ts2=NOW() WHERE id=$id"); if ($success && !empty($ncomment)) { $success = @mysql_query("INSERT INTO bugdb_comments (bug, email, ts, comment) VALUES ($id,'$user@php.net',NOW(),'$ncomment')"); } } $from = "$user@php.net"; } if ($modify && $success) { # mail out the updated bug $text = "ID: $id\n"; if ($modify == "developer") { $text .= "Updated by: $user\n"; } else { $text .= "User updated by: $email\n"; } $text.= "Reported By: $original[email]\n"; if (stripslashes($sdesc) != $original[sdesc]) $text .= "Old Summary: $original[sdesc]\n"; if ($status!=$original[status]) $text .= "Old Status: $original[status]\n"; $text.= "Status: $status\n"; if ($bug_type != $original[bug_type]) $text .= "Old Bug Type: $original[bug_type]\n"; $text.= "Bug Type: $bug_type\n"; if ($php_os != $original[php_os]) $text .= "Old Operating System: $original[php_os]\n"; $text.= "Operating System: $php_os\n"; if ($php_version != $original[php_version]) $text .= "Old PHP Version: $original[php_version]\n"; $text.= "PHP Version: $php_version\n"; if ($assign != $original[assign]) $text .= "Old Assigned To: $original[assign]\n"; if ($assign || $original[assign]) $text.= "Assigned To: $assign\n"; if ($ncomment) $text .= "New Comment:\n\n".stripslashes($ncomment); $text.= get_old_comments($id); $user_text = $text . "\n\nATTENTION! Do NOT reply to this email!\n"; $user_text.= "To reply, use the web interface found at http://bugs.php.net/?id=$id&edit=2\n"; $dev_text .= $text . "\n\nEdit this bug report at http://bugs.php.net/?id=$id&edit=1\n"; list($mailto,$mailfrom) = get_bugtype_mail($bug_type); /* send mail if status was changed or there is a comment */ if ($status != $original[status] || $ncomment != "") { @mail($original[email], "Bug #$id Updated: ".stripslashes($sdesc), $user_text, "From: Bug Database <$mailfrom>\nX-PHP-Bug: $id\nIn-Reply-To: "); @mail($mailto, "Bug #$id Updated: ".stripslashes($sdesc), $dev_text, "From: $from\nX-PHP-Bug: $id\nIn-Reply-To: "); } # display a happy success message echo "

Bug #$id updated successfully.

\n"; unset($ncomment); } elseif ($modify && !$success) { echo "

Something went wrong updating the database.

"; } /* DISPLAY BUG */ if ($edit) { echo "
\n"; echo "\n"; } if ($edit==1) echo '',"\n"; if ($edit==2) echo '',"\n"; ?>

Bug id #

&edit=2">User Modify&edit=1">Dev Modify
Status: Assign To: &edit=2">User Modify   &edit=1">Dev Modify
From:
Reported:
Type:
OS:
PHP Version:
Assigned To:
Summary:
New Comment:
CVS Username:
Password: [Lost your password?]
Remember me: (Check here to remember your password for next time.)
     
\n"; echo hdelim(); /* ORIGINAL REPORT */ echo "[$original[ts1]] $original[email]
\n"; echo "
";
	echo wordwrap(addlinks($original[ldesc]),90);
	echo "
\n"; /* COMMENTS */ $query = "SELECT * FROM bugdb_comments WHERE bug=$id ORDER BY ts"; if ($comresult = mysql_query($query)) { while ($com = mysql_fetch_array($comresult)) { echo "[$com[ts]] $com[email]
\n"; echo "
";
			echo wordwrap(addlinks($com[comment]),90);
			echo "
\n"; } } commonFooter(); exit; } elseif (!isset($cmd)) { ?>

Report a Bug


Please read the Dos & Don'ts before submitting a bug report!
If you are not sure if the problem you're experiencing is a bug at all it most likely isn't. Please ask support questions on the mailing lists.
"the beginning", "1" => "yesterday", "7" => "7 days ago", "15" => "15 days ago", "30" => "30 days ago", "90" => "90 days ago", ); while (list($k,$v) = each($opts)) { echo "\n"; } } function show_limit_options($limit=30) { for($i=10;$i<100;) { echo "\n"; $i=$i+10; } echo '\n"; } function show_state_options($state, $user_mode=0, $default="") { if (!$state && !$default) { $state = "Open"; } elseif (!$state) { $state = $default; } $state_types = array ( "Open" => 2, "Closed" => 2, "Duplicate" => 2, "Critical" => 1, "Assigned" => 1, "Analyzed" => 1, "Suspended" => 1, "Feedback" => 1, "Old Feedback" => 0, "Stale" => 0, "Bogus" => 1, "All" => 0 ); /* regular users can only pick states with type 2 for unclosed bugs */ if($state != "All" && $state_types[$state] == 1 && $user_mode == 2) { /* If state was 'Feedback', set state to 'Open' automatically. */ if($state == "Feedback") { echo "\n"; } else { echo "\n"; } if($state != "Bogus") echo "\n"; } else { foreach($state_types as $type => $mode) { if ($mode >= $user_mode) { echo "$type\n"; } } } } function show_version_options($current,$default="") { $versions = array("4.0.6","4.0.5","4.0.4pl1","4.0.4","4.0CVS-".date("Y-m-d")); while (list(,$v) = each($versions)) { echo "$v\n"; if ($current == $v) $use++; } if (!$use && $current) echo "\n"; echo "\n"; } function show_types($current,$show_any,$default="") { include 'bugtypes.inc'; if (!$current && !$default && !$show_any) { echo "\n"; } elseif (!$current && $show_any) { $current = "Any"; } elseif (!$current) { $current = $default; } while (list($key,$value) = each($items)) { if ($show_any || $key != "Any") { echo "\n"; if ($key == $current) $use++; } } if (!$use && $current) { echo "\n"; } } function get_old_comments ($bug_id) { $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"); if (!$res) return ""; # skip the most recent (this is get_old_comments, not get_all_comments!) $row = mysql_fetch_row($res); if (!$row) return ""; while (($row = mysql_fetch_row($res)) && strlen($output) < $max_message_length && $count++ < $max_comments) { $output .= "[$row[0]] $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_row($res); if (!$row) return $output; return ("\n\nPrevious Comments:\n$divider\n\n" . $output . "[$row[0]] $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/?id=$bug_id\n"); } return ""; } function addlinks($text) { $text = htmlspecialchars($text); $text = preg_replace("/((mailto|http|ftp|nntp|news):.+?)(>|\\s|\\)|\\.\\s|$)/i","\\1\\3",$text); # what the heck is this for? $text = preg_replace("/[.,]?-=-\"/", '"', $text); return $text; } /* validate an incoming bug report */ function incoming_details_are_valid($require_ldesc=0,$require_passwd=0) { global $email,$bug_type,$php_version,$sdesc,$ldesc,$passwd; $valid = 1; if(!preg_match("/[.\\w+-]+@[.\\w-]+\\.\\w{2,}/i",$email)) { echo "

Please provide a valid email address.

"; $valid = 0; } if ($bug_type=="none") { echo "

Please select an appropriate bug type.

"; $valid = 0; } if ($php_version=='earlier') { echo "

Please select a valid PHP version. If your PHP version is too old, please upgrade first and see if the problem has not already been fixed.

"; $valid = 0; } if (!$sdesc) { echo "

You must supply a short description of the bug you are reporting.

"; $valid = 0; } if ($require_ldesc && !$ldesc) { echo "

You must supply a long description of the bug you are reporting.

"; $valid = 0; } if ($require_passwd && empty($passwd)) { echo "

You must supply a password for this bug report.

"; $valid = 0; } return $valid; } function get_bugtype_mail($bug_type) { global $mail_bugs_to; if (eregi("documentation", $bug_type)) { return array("$mail_bugs_to,phpdoc@lists.php.net",$mail_bugs_to); } elseif (eregi("website", $bug_type)) { return array("php-mirrors@lists.php.net","php-mirrors@lists.php.net"); } else { return array($mail_bugs_to,$mail_bugs_to); } } function get_row_color($row) { if ($row["bug_type"]=="Feature/Change Request") { return "#aaaaaa"; } switch($row["status"]) { case "Open": return "#ffbbaa"; break; case "Critical": return "#ff0000"; break; case "Closed": return "#aaffbb"; break; case "Suspended": return "#ffccbb"; break; case "Assigned": return "#bbaaff"; break; case "Feedback": return "#bbeeff"; break; case "Analyzed": return "#99bbaa"; break; case "Duplicate": return "#bbbbbb"; break; default: return "#aaaaaa"; break; } } function show_prev_next($begin,$rows,$link,$limit) { if($limit=='All') return; if ($begin == 0 && $rows < $limit) return; echo ""; echo ''; if ($begin > 0) { echo ""; } if ($rows >= $limit) { echo ""; } echo "
« Show Previous $limit EntriesShow Next $limit Entries »
"; } /* # MySQL dump 4.0 # # Host: localhost Database: php3 #-------------------------------------------------------- DROP table bugdb; CREATE TABLE bugdb ( id int(8) NOT NULL AUTO_INCREMENT, bug_type char(32), email varchar(40) NOT NULL, sdesc varchar(80), ldesc text, php_version char(16), php_os varchar(32), status varchar(16), ts1 datetime, # bug created date ts2 datetime, # bug last updated date dev_id varchar(16),# developer who last commented assign varchar(16), passwd varchar(20),# user password PRIMARY KEY (id) ); CREATE TABLE bugdb_comments ( id int(8) NOT NULL AUTO_INCREMENT, bug int(8) NOT NULL, email varchar(40) NOT NULL, ts datetime NOT NULL, comment text, PRIMARY KEY (id) ); */ ?>