if($save && $user && $pw) {
SetCookie("MAGIC_COOKIE",base64_encode("$user:$pw"),time()+3600*24*12,'/');
}
/* See the end of the script for the table layout. */
require("shared.inc");
if (strstr($MYSITE,"bugs.php.net")) {
$dbhost="localhost";
$dbuser="nobody";
$dbpwd="";
} else if (strstr($MYSITE,"il.php.net")) {
$dbhost="bugs.php.net";
$dbuser="bourbon";
$dbpwd="";
} else if (strstr($MYSITE,"localhost")) {
$dbhost="localhost";
$dbuser="nobody";
$dbpwd="";
} else {
Header("Location: http://bugs.php.net");
exit;
}
$DISABLE_KICKOUTS=1;
commonHeader("Bug Reporting");
echo "\n";
$destination = "php-dev@lists.php.net";
#$destination = "zak@php.net";
function indent($string, $prefix) {
$string = ereg_replace(13, "", $string); /* get rid of Ctrl-M */
return $prefix . ereg_replace("\n", "\n$prefix", $string) . "\n";
}
function wrap($text,$margin=72) {
$i=0;
$last_space=0;
$printfrom=0;
$len=strlen($text);
$line_len=0;
while($i<$len) {
if($text[$i]==chr(32) || $text[$i]==chr(7)) {
$last_space=$i;
$line_len++;
} else
if($text[$i]==chr(10) || $text[$i]==chr(13)) {
$line_len=0;
} else {
$line_len++;
}
if($line_len>$margin) {
if($last_space==0 || $last_space<$printfrom) {
echo substr($text,$printfrom,$margin);
echo "\n";
$printfrom+=$margin+1;
} else {
echo substr($text,$printfrom,$last_space-$printfrom);
echo "\n";
$printfrom=$last_space+1;
}
$line_len=0;
}
$i++;
}
echo substr($text,$printfrom);
}
function list_ids($current) {
global $dbhost,$dbuser,$dbpwd;
mysql_connect($dbhost,$dbuser,$dbpwd) or die("Unable to connect to SQL server.");
$result = mysql_db_query('php3', "select distinct dev_id from bugdb where dev_id not like '%@%' and dev_id not like '%.%' and php_version like '4%' order by dev_id");
if($current) echo "";
}
function _types_show_subtopics ($subtopics, $selected, $level = 0)
{
foreach ($subtopics as $heading => $subheadings) {
if (!is_array ($subheadings)) {
_types_display_entry ($subheadings, $selected, $level);
continue;
}
_types_display_entry ($heading, $selected, $level);
_types_show_subtopics ($subheadings, $selected, $level+1);
}
}
function find_password($user) {
$fp=@fopen("/repository/CVSROOT/passwd","r");
if (!$fp) {
return ("");
}
while(!feof($fp)) {
$line=fgets($fp,120);
list($luser,$passwd,$junk) = explode(":",$line);
if($user==$luser) {
fclose($fp);
return($passwd);
}
}
fclose($fp);
return("");
}
function addlinks($text) {
$text = htmlspecialchars($text);
$new_text = ereg_replace("(http:[^ \n\t]*)","\\1",$text);
$new_text = ereg_replace("(ftp:[^ \n\t]*)","\\1",$text);
$new_text = ereg_replace("[.,]-=-\"","\"",$new_text);
$new_text = ereg_replace("-=-\"","\"",$new_text);
return $new_text;
}
if (isset($cmd) && $cmd == "Send bug report") {
if(!ereg("@",$email)) {
echo "ERROR! Please provide a valid email address \n";
commonFooter();
exit;
}
if($ebug_type=="--Please Select--") {
echo "ERROR! Please select an appropriate bug type \n";
commonFooter();
exit;
}
if ($php_version=='earlier') {
echo "ERROR! 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.";
commonFooter();
exit;
}
show_menu($status);
echo " ";
echo "The password for this report is: ".htmlentities($passwd)."
\n";
mysql_connect($dbhost,$dbuser,$dbpwd) or die("Unable to connect to SQL server.");
mysql_select_db("php3");
$ts=date("Y-m-d H:i:s");
$ret = mysql_query("INSERT into bugdb values (0,'$ebug_type','$email','$sdesc','$ldesc','$php_version','$php_os','Open','','$ts','$ts','','','$passwd')");
$cid = mysql_insert_id();
$report = "";
echo("\n");
$ldesc = stripslashes($ldesc);
$sdesc = stripslashes($sdesc);
$report .= "From: $email\n";
$report .= "Operating system: $php_os\n";
$report .= "PHP version: $php_version\n";
$report .= "PHP Bug Type: $ebug_type\n";
$report .= "Bug description: ";
$html_sdesc = ereg_replace("<", "<", $sdesc);
$html_sdesc = ereg_replace(">", ">", $html_sdesc);
$report .= $html_sdesc."\n\n";
$ascii_report = indent($report.$ldesc,"");
$html_desc = ereg_replace("<", "<", $ldesc);
$html_desc = ereg_replace(">", ">", $html_desc);
$report .= $html_desc."\n";
$html_report = ereg_replace("<", "<", $report);
$html_report = ereg_replace(">", ">", $html_report);
echo wrap($html_report);
echo("\n");
if (Mail($destination, "PHP 4.0 Bug #$cid: $sdesc", $ascii_report, "From: $email")) {
echo "Mail sent to $destination...
\n";
echo "Thank you for your help!
";
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 " .
"$email manually.\n");
}
} elseif(isset($cmd) && $cmd=="Display Bugs") {
show_menu($status);
echo "
\n";
include("table_wrapper.inc");
function external_processing($fieldname,$tablename,$data,$row)
{
switch($fieldname) {
case "id":
print "$data\n";
break;
case "Originator":
print "$data\n";
break;
case "Mod":
print "
\n";
break;
case "Status":
if ($data == "Feedback") {
echo "Feedback
(".$row[unchanged_days]." days)";
break;
}
/* otherwise fall through */
default:
$data = ereg_replace("<","<",$data);
$data = ereg_replace(">",">",$data);
print $data;
break;
}
}
function row_coloring($row) {
if ($row["bug_type"]=="Feature/Change Request") {
return "#aaaaaa";
}
switch($row["Status"]) {
case "Open":
return "#ffbbaa";
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;
}
}
$external_processing_function="external_processing";
$row_coloring_function="row_coloring";
mysql_connect($dbhost,$dbuser,$dbpwd) or die("Unable to connect to SQL server");
mysql_select_db("php3");
$tables[] = "bugdb";
$fields[] = "id";
$fields[] = "bug_type";
$fields[] = "status as Status";
$fields[] = "assign as Assigned";
$fields[] = "php_version as Version";
# $fields[] = "php_os as OS";
$fields[] = "php_os as Platform";
$fields[] = "sdesc as Description";
$fields[] = "id as Mod";
$fields[] = "TO_DAYS(NOW())-TO_DAYS(ts2) as unchanged_days";
$conversion_table["id"] = "ID#";
$conversion_table["bug_type"] = "Bug Type";
$pass_on = ereg_replace(" ","+","&cmd=Display+Bugs&status=$status&bug_type=$bug_type");
$default_header_color="aaaaaa";
$centering["id"] = $centering["Mod"] = "center";
$dont_link["Mod"]=1;
$dont_display["unchanged_days"] = 1;
if (!isset($order_by_clause)) {
$order_by_clause = "id";
}
if($status=="All" && $bug_type=="Any") {
$where_clause = "bug_type!='Feature/Change Request'";
/* nothing */
} elseif($status=="All" && $bug_type!="Any") {
$where_clause = "bug_type='$bug_type'";
} else {
if($bug_type=="Any") {
$where_clause = "bug_type!='Feature/Change Request'";
} else {
$where_clause = "bug_type='$bug_type'";
}
/* Treat assigned and analyzed bugs as open */
if($status=="Open") {
$where_clause .= " and (status='Open' or status='Assigned' or status='Analyzed')";
} elseif($status=="OldFeedback") {
$where_clause .= " and status='Feedback' and TO_DAYS(NOW())-TO_DAYS(ts2)>60";
} else {
$where_clause .= " and status='$status'";
}
}
if(strlen($search_for)) {
$where_clause .= " and (sdesc like '%$search_for%' or ldesc like '%$search_for%' or comments like '%$search_for%')";
}
if (strlen($where_clause)) {
$where_clause .= " and";
}
$where_clause .= " php_version like '4%'";
if(strlen($by) and $by!='Any') $where_clause .= " and dev_id = '$by' ";
table_wrapper();
echo "
| Status: | ".$row[7]." | "; echo "Modify | "; } else { echo "||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Status: | \n"; if($edit==1) { echo "Assign to: \n"; echo "\n"; } } echo " | |||||||||||||||||||||||
| From: | ".$row[2].""; echo " | |||||||||||||||||||||||
| Date: | ".$row[9]." | |||||||||||||||||||||||
| Type: | ".$row[1]." | |||||||||||||||||||||||
| Type: | \n"; show_types($row[1],0,"ebug_type"); echo " | |||||||||||||||||||||||
| OS: | ||||||||||||||||||||||||
| OS: | ".$row[6]." | |||||||||||||||||||||||
| PHP Version: | ||||||||||||||||||||||||
| PHP Version: | ".$row[5]." | |||||||||||||||||||||||
| Assigned To: | ".$row[12]." | |||||||||||||||||||||||
| Short Desc.: | $sd |
\n"; /* OLD-STYLE DEVELOPER COMMENT */ if(strlen($row[8])) { echo "[".$row[10]."] ".$row[11].""; echo wrap($text,90); echo "
\n"; } /* NEW-STYLE COMMENTS */ $query = "SELECT *,UNIX_TIMESTAMP(ts) AS my_when 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'].""; wrap($text,90); echo "
\n"; } mysql_freeresult($comresult); } } else { echo ""; wrap($text,90); echo "
Please read the Dos & Don'ts before submitting a bug report!
To report bugs in PHP 3.0, please go here.
| Your email address: | ||
|---|---|---|
| PHP version: | ||
| Type of bug: | ||
| Operating system: | "> | |
| Bug description: | ||
| Password: | You may enter any password here. This password allows you to come back and modify your submitted bug report at a later date. | |
Please supply any information that may be helpful in fixing the bug:
|