\n"; $destination = "php-dev@php.iquest.net"; #$destination = "rasmus@lerdorf.on.ca"; function indent($string, $prefix) { $string = ereg_replace(13, "", $string); /* get rid of Ctrl-M */ return $prefix . ereg_replace("\n", "\n$prefix", $string) . "\n"; } function show_menu($state) { global $PHP_SELF, $bug_type; if(!isset($bug_type)) { $bug_type="Any"; } echo "
\n"; echo "\n"; echo " bugs of type "; show_types($bug_type,1,"bug_type"); $fields = array( "id" => "Bug ID", "bug_type" => "Bug Type", "email" => "Submitter's Email address", "sdesc" => "Short Description", "ldesc" => "Long Description", "php_version" => "PHP Version", "php_os" => "Platform", "status" => "Status", "comments" => "Comments", "ts1" => "TimeStamp 1", "ts2" => "Timestamp 2", "assign" => "Assigned"); reset($fields); echo "Order by: \n"; echo "
\n"; } function show_types($first_item,$show_any,$var_name) { $items = array("Any", "Feature/Change Request", "Documentation problem", "Installation problem", "Compile Failure", "Compile Warning", "Parser error", "Reproduceable crash", "Performance problem", "MySQL related", "mSQL related", "PostgreSQL related", "ODBC related", "Oracle related", "Sybase related", "Solid related", "Adabas-D related", "dBase related", "dbm related", "Other"); echo "\n"; } function find_password($user) { $fp=fopen("/repository/CVSROOT/passwd","r"); 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 "Please provide a valid email address

\n"; include("include/footer.inc"); exit; } if($ebug_type=="--Please Select--") { echo "Please select an appropriate bug type

\n"; include("include/footer.inc"); exit; } show_menu($status); echo "


\n"; mysql_pconnect("localhost","",""); 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','','')"); $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:\n";
	$ascii_report = indent($report.$ldesc,"");
    $html_desc = ereg_replace("<", "<", $ldesc);
    $html_desc = ereg_replace(">", ">", $html_desc);
    $report .= indent($html_desc, "    ");

    $html_report = ereg_replace("<", "<", $report);
    $html_report = ereg_replace(">", ">", $html_report);

    echo $html_report;

    echo("
\n"); if (Mail($destination, "Bug #$cid: $sdesc", $ascii_report, "From: $email")) { echo "

Mail sent to $destination...

\n"; echo "Thank you for your help!

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 "at any time. The URL for your bug report is: "; echo "http://ca.php.net/bugs.php3?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 "Modify": print "\n"; break; default: $data = ereg_replace("<","<",$data); $data = ereg_replace(">",">",$data); print $data; break; } } function row_coloring($row) { switch($row["Status"]) { case "Open": return "#ffbbaa"; break; case "Closed": return "#aaffbb"; break; case "Assigned": return "#bbaaff"; break; case "Analyzed": return "#99bbaa"; break; default: return "#aaaaaa"; break; } } $external_processing_function="external_processing"; $row_coloring_function="row_coloring"; mysql_pconnect("localhost","",""); 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[] = "email as Originator"; $fields[] = "sdesc as Description"; $fields[] = "id as Modify"; $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["Modify"] = "center"; $dont_link["Modify"]=1; if (!isset($order_by_clause)) { $order_by_clause = "id"; } if($status=="All" && $bug_type=="Any") { /* nothing */ } elseif($status=="All" && $bug_type!="Any") { $where_clause = "bug_type='$bug_type'"; } elseif($status!="All" && $bug_type=="Any") { /* Treat assigned bugs as open */ if($status=="Open") { $where_clause = "status='Open' or status='Assigned'"; } else { $where_clause = "status='$status'"; } } else { if($status=="Open") { $where_clause = "(status='Open' or status='Assigned') and bug_type='$bug_type'"; } else { $where_clause = "status='$status' and bug_type='$bug_type'"; } } table_wrapper("php3"); echo "
Submit a Bug Report
\n"; } else if(!isset($cmd) && isset($id)) { show_menu($status); echo "
\n"; mysql_pconnect("localhost","",""); mysql_select_db("php3"); if(isset($modify) && $modify=="Edit Bug") { $ok=0; if($user!="cvsread") { $psw=find_password($user); if(strlen($psw)>0) { if(crypt($pw,substr($psw,0,2))==$psw) { $ts=date("Y-m-d H:i:s"); if($estatus=="Delete!") { mysql_query("DELETE from bugdb where id=$id"); } else { mysql_query("UPDATE bugdb set status='$estatus', bug_type='$ebug_type', assign='$eassign', comments='$comments', ts2='$ts', dev_id='$user' where id=$id"); } $ok=1; } } } if(!$ok) { echo "Sorry, incorrect user id/password pair.
\n"; Mail("rasmus@lerdorf.on.ca", "bugdb auth failure for $user/$pw", "", "From: bugdb"); } else { echo "Database updated!
\n"; if($estatus=="Delete!") { $comments = stripslashes($comments); $text = "Bug #$id has been deleted from the database by $user\nComments: $comments\n"; } else { $text = "ID: $id\nUpdated by: $user\nReported By: $eemail\nStatus: $estatus\nBug Type: $ebug_type\nAssigned To: $eassign\nComments: $comments\n"; $text .= "\nFull Bug description available at: http://ca.php.net/bugs.php3?id=$id\n"; $text = stripslashes($text); } $esdesc = stripslashes($esdesc); Mail($eemail, "Bug #$id Updated: $esdesc", $text, "From: Bug Database "); Mail("php-dev@php.iquest.net", "Bug #$id Updated: $esdesc", $text, "From: Bug Database "); } } $result = mysql_query("SELECT * from bugdb where id=$id"); if(mysql_numrows($result)>0) { $row = mysql_fetch_row($result); echo "

Bug id #$id

\n"; echo "\n"; if(!isset($edit)) { echo ""; echo ""; } else { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if(!isset($edit)) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; $sd = ereg_replace("<","<",$row[3]); $sd = ereg_replace(">",">",$sd); echo "\n"; echo "
Status:".$row[7]."Modify
Status:\n"; echo "Assign to: \n"; } echo "
From:".$row[2].""; echo "
Date:".$row[9]."
Type:".$row[1]."
Type:\n"; show_types($row[1],0,"ebug_type"); echo "
OS:".$row[6]."
PHP Version:".$row[5]."
Assigned To:".$row[12]."
Short Desc.:$sd
\n"; $text = addlinks($row[4]); echo "
".$text."
\n"; if(!isset($edit)) { if(strlen($row[8])) { echo "[".$row[10]."] Updated by ".$row[11]."
\n"; $text=addlinks($row[8]); echo "
".$text."
\n"; } } else { echo "Developer Comments:
\n"; echo "
\n"; echo "CVS user id: \n"; echo "CVS password: \n"; echo "\n"; echo "\n"; } } else { if(isset($modify) && $estatus=="Delete!") { echo "

Bug id #$id has been deleted

\n"; } else { echo "

Sorry bug id #$id does not exist

\n"; } } mysql_freeresult($result); } else { show_menu($status); ?> Or use the form below to submit a new bug report.

Please make sure you have read our list of Frequently Asked Questions to see whether your problem may already be a known issue, and also check the bug database for any outstanding bug reports that match your bug.

Your email address:
PHP version:
Type of bug:
Operating system: ">
Bug description:
Please supply any information that may be helpful in fixing the bug:
  • A short script that reproduces the problem
  • The list of modules you compiled PHP with (your configure line)
  • A copy of your php3.ini file (if it might be relevant)
  • Any other information unique or specific to your setup