cvs: bugtracker /htdocs config.php /htdocs/index index.php /includes bug.php cache.php cachelist.php comment.php database_mysql.php
database_mysqli.php email.php functions.php recaptchalib.php user.php /includes/cache account_type.php bug_type.php comment_type.php os_version.php
php_version.php status.php /template/generic/bug index.php
| From: | Barry Carlyon | Date: | Thu, 10 Jul 2008 20:11:12 +0000 |
| Subject: | cvs: bugtracker /htdocs config.php /htdocs/index index.php /includes bug.php cache.php cachelist.php comment.php database_mysql.php database_mysqli.php email.php functions.php recaptchalib.php user.php /includes/cache account_type.php bug_type.php comment_type.php os_version.php php_version.php status.php /template/generic/bug index.php |
||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-2074@lists.php.net to get a copy of this message | ||
bcarlyon Thu Jul 10 20:11:12 2008 UTC
Added files:
/bugtracker/includes database_mysql.php database_mysqli.php
/bugtracker/htdocs config.php
Modified files:
/bugtracker/htdocs/index index.php
/bugtracker/includes bug.php cache.php cachelist.php comment.php
email.php functions.php recaptchalib.php
user.php
/bugtracker/includes/cache account_type.php bug_type.php
comment_type.php os_version.php
php_version.php status.php
/bugtracker/template/generic/bug index.php
Log:
Summary of work done on Google London Trip
Switched to MYSQLi
Modified related classes
Added the mysqli_real_escape_string function
http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/index/index.php?r1=1.2&r2=1.3&diff_format=u Index: bugtracker/htdocs/index/index.php diff -u bugtracker/htdocs/index/index.php:1.2 bugtracker/htdocs/index/index.php:1.3 --- bugtracker/htdocs/index/index.php:1.2 Thu Jul 10 00:10:05 2008 +++ bugtracker/htdocs/index/index.php Thu Jul 10 20:11:12 2008 @@ -8,7 +8,7 @@ ***********************************************************/ //before we start lets see if the database engine is online -include($_SERVER['DOCUMENT_ROOT'] . '../includes/database.php'); +include($_SERVER['DOCUMENT_ROOT'] . '/config.php'); include($_SERVER['DOCUMENT_ROOT'] . '../includes/functions.php'); //database time @@ -18,7 +18,8 @@ if ($dbtest == 'offline' || !$dbtest) { //arg! were offline - header('Location: /offline.html'); + include($_SERVER['DOCUMENT_ROOT'] . 'offline.html'); + //header('Location: /offline.html'); exit; } @@ -179,5 +180,4 @@ ?> -</body></html> - +</body></html> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/bug.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/bug.php diff -u bugtracker/includes/bug.php:1.1 bugtracker/includes/bug.php:1.2 --- bugtracker/includes/bug.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/bug.php Thu Jul 10 20:11:12 2008 @@ -40,7 +40,15 @@ $bug_data['password'] = md5($bug_data['password']); //add bug - $query = 'INSERT INTO bug (' . implode(', ', array_keys($bug_data)) . ') VALUES ("' . implode('", "', array_values($bug_data)) . '")'; +// $query = 'INSERT INTO bug (' . implode(', ', array_keys($bug_data)) . ') VALUES ("' . implode('", "', array_values($bug_data)) . '")'; + $query = 'INSERT INTO bug (' . implode(', ', array_keys($bug_data)) . ') VALUES ("'; + foreach (array_values($bug_data) as $data) + { + $query .= $db->protect_data($data); + $query .= '","'; + } + $query = substr($query,0,-2); + $query .= ')'; $db->get_data($query); $this->bug_id = $db->insert_id; @@ -68,4 +76,4 @@ } } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cache.php diff -u bugtracker/includes/cache.php:1.1 bugtracker/includes/cache.php:1.2 --- bugtracker/includes/cache.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cache.php Thu Jul 10 20:11:12 2008 @@ -75,9 +75,7 @@ define(strtoupper(str_replace(\' \',\'_\',$data)),$ref); } -?> - -'; +?>'; } else { @@ -90,4 +88,4 @@ } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cachelist.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cachelist.php diff -u bugtracker/includes/cachelist.php:1.1 bugtracker/includes/cachelist.php:1.2 --- bugtracker/includes/cachelist.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cachelist.php Thu Jul 10 20:11:12 2008 @@ -9,4 +9,4 @@ $account_type = array(); $user_data = array(); -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/comment.php?r1=1.2&r2=1.3&diff_format=u Index: bugtracker/includes/comment.php diff -u bugtracker/includes/comment.php:1.2 bugtracker/includes/comment.php:1.3 --- bugtracker/includes/comment.php:1.2 Thu Jul 10 00:10:40 2008 +++ bugtracker/includes/comment.php Thu Jul 10 20:11:12 2008 @@ -18,6 +18,7 @@ } function add_comment($type,$bug_id,$text,$handle) { global $db; + $text = $db->protect_data($text); $query = 'INSERT INTO bug_comment(bug_id,comment_type,comment,handle,added) VALUES ' . "('{$bug_id}', '{$type}', '{$text}', '{$handle}', NOW())"; $db->get_data($query); @@ -58,4 +59,4 @@ } } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/email.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/email.php diff -u bugtracker/includes/email.php:1.1 bugtracker/includes/email.php:1.2 --- bugtracker/includes/email.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/email.php Thu Jul 10 20:11:12 2008 @@ -70,4 +70,4 @@ } } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/functions.php?r1=1.2&r2=1.3&diff_format=u Index: bugtracker/includes/functions.php diff -u bugtracker/includes/functions.php:1.2 bugtracker/includes/functions.php:1.3 --- bugtracker/includes/functions.php:1.2 Thu Jul 10 00:11:45 2008 +++ bugtracker/includes/functions.php Thu Jul 10 20:11:12 2008 @@ -80,11 +80,12 @@ (preg_match('/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/',$email)) ) { $host = explode('@', $email); - if(checkdnsrr($host[1].'.', 'MX') ) return true; - if(checkdnsrr($host[1].'.', 'A') ) return true; - if(checkdnsrr($host[1].'.', 'CNAME') ) return true; +// if(checkdnsrr($host[1].'.', 'MX') ) return true; +// if(checkdnsrr($host[1].'.', 'A') ) return true; +// if(checkdnsrr($host[1].'.', 'CNAME') ) return true; + return true; } return false; } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/recaptchalib.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/recaptchalib.php diff -u bugtracker/includes/recaptchalib.php:1.1 bugtracker/includes/recaptchalib.php:1.2 --- bugtracker/includes/recaptchalib.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/recaptchalib.php Thu Jul 10 20:11:12 2008 @@ -274,4 +274,4 @@ } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/user.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/user.php diff -u bugtracker/includes/user.php:1.1 bugtracker/includes/user.php:1.2 --- bugtracker/includes/user.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/user.php Thu Jul 10 20:11:12 2008 @@ -164,4 +164,4 @@ } } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache/account_type.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cache/account_type.php diff -u bugtracker/includes/cache/account_type.php:1.1 bugtracker/includes/cache/account_type.php:1.2 --- bugtracker/includes/cache/account_type.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cache/account_type.php Thu Jul 10 20:11:12 2008 @@ -8,5 +8,4 @@ define(strtoupper(str_replace(' ','_',$data)),$ref); } -?> - +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache/bug_type.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cache/bug_type.php diff -u bugtracker/includes/cache/bug_type.php:1.1 bugtracker/includes/cache/bug_type.php:1.2 --- bugtracker/includes/cache/bug_type.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cache/bug_type.php Thu Jul 10 20:11:12 2008 @@ -8,5 +8,4 @@ define(strtoupper(str_replace(' ','_',$data)),$ref); } -?> - +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache/comment_type.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cache/comment_type.php diff -u bugtracker/includes/cache/comment_type.php:1.1 bugtracker/includes/cache/comment_type.php:1.2 --- bugtracker/includes/cache/comment_type.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cache/comment_type.php Thu Jul 10 20:11:12 2008 @@ -10,5 +10,4 @@ define(strtoupper(str_replace(' ','_',$data)),$ref); } -?> - +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache/os_version.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cache/os_version.php diff -u bugtracker/includes/cache/os_version.php:1.1 bugtracker/includes/cache/os_version.php:1.2 --- bugtracker/includes/cache/os_version.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cache/os_version.php Thu Jul 10 20:11:12 2008 @@ -8,5 +8,4 @@ define(strtoupper(str_replace(' ','_',$data)),$ref); } -?> - +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache/php_version.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cache/php_version.php diff -u bugtracker/includes/cache/php_version.php:1.1 bugtracker/includes/cache/php_version.php:1.2 --- bugtracker/includes/cache/php_version.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cache/php_version.php Thu Jul 10 20:11:12 2008 @@ -14,5 +14,4 @@ define(strtoupper(str_replace(' ','_',$data)),$ref); } -?> - +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache/status.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cache/status.php diff -u bugtracker/includes/cache/status.php:1.1 bugtracker/includes/cache/status.php:1.2 --- bugtracker/includes/cache/status.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cache/status.php Thu Jul 10 20:11:12 2008 @@ -8,5 +8,4 @@ define(strtoupper(str_replace(' ','_',$data)),$ref); } -?> - +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/index.php?r1=1.2&r2=1.3&diff_format=u Index: bugtracker/template/generic/bug/index.php diff -u bugtracker/template/generic/bug/index.php:1.2 bugtracker/template/generic/bug/index.php:1.3 --- bugtracker/template/generic/bug/index.php:1.2 Thu Jul 10 00:12:20 2008 +++ bugtracker/template/generic/bug/index.php Thu Jul 10 20:11:12 2008 @@ -19,7 +19,11 @@ if ($db->total_rows) { //lets shunt out a text file - echo 'here be a forced download of a text file, well sorta...'; + header("Cache-Control: no-cache, must-revalidate"); + header("Content-Type: text/plain"); + header('Content-Disposition: attachment; filename="bug_reproduce_code_bugid_' . $bug_id . '.txt"'); + $file = $db->fetch_row(); + echo $file['comment']; exit; } else @@ -190,4 +194,4 @@ } } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/database_mysql.php?view=markup&rev=1.1 Index: bugtracker/includes/database_mysql.php +++ bugtracker/includes/database_mysql.php <?php //class class db { public $query_count = 0; function test_connect() { global $database; $this->host = $database['host']; $this->name = $database['name']; $this->user = $database['user']; $this->pass = $database['password']; if (!($connection = @ mysql_connect($database['host'], $database['user'], $database['password']))) { return 'offline'; } $this->connect_id = $connection; if (! @ mysql_select_db($this->name)) { //no db name connect return 'offline'; } return ($connection); } function protect_data($data) { //$data = mysqli_real_escape_string($this->connect_id,$data); return $data; } function get_data($query) { $query = str_replace(array('"NOW()"',"'NOW()'"),'NOW()',$query); $this->query = $query; $this->query_count ++; //global $content; //$content .= '<br />I did a query! ' . $query . ' - ' . $this->query_count . '<br />'; if(!($result = @ mysql_query ($query, $this->connect_id))) { $this->handle_error(); } else { $this->result = $result; $this->insert_id = ''; $this->affected_rows = ''; $this->total_rows = ''; if (substr($query,0,11) == 'INSERT INTO') { $this->insert_id = mysql_insert_id($this->connect_id); } else if (substr($query,0,6) == 'UPDATE') { $this->affected_rows = mysql_affected_rows($this->connect_id); } else if (substr($query,0,6) == 'SELECT') { $this->total_rows = mysql_num_rows($this->result); } return $result; } } function fetch_row($result = '') { $result = $result ? $result : $this->result; return mysql_fetch_array($result); } function handle_error($error = '') { global $content; $content .= "<br /><br /><b>Error " . mysql_errno() . " : ". mysql_error() . ' - ' . $this->query . '</b><br /><br />'; return; } function close() { @ mysql_close($this->connect_id); } } //////////////////////////////////////////////////////////////////////////// /* function getdata($query) { //make a database connection global $database; if (!($connection = @ mysql_connect($database['host'], $database['user'], $database['password']))) { return "offline"; } else { if (!(mysql_select_db($database['name']))) showerror(); if(!($result = @ mysql_query ($query, $connection))) showerror(); } return $result; } function showerror() { print("Error " . mysql_errno() . " : ". mysql_error()); } */ ?> http://cvs.php.net/viewvc.cgi/bugtracker/includes/database_mysqli.php?view=markup&rev=1.1 Index: bugtracker/includes/database_mysqli.php +++ bugtracker/includes/database_mysqli.php <?php //class class db { public $query_count = 0; function test_connect() { global $database; $this->host = $database['host']; $this->name = $database['name']; $this->user = $database['user']; $this->pass = $database['password']; if (!($connection = mysqli_connect($database['host'], $database['user'], $database['password'], $database['name']))) { return 'offline'; } $this->connect_id = $connection; /* if (! @ mysqli_select_db($this->name)) { //no db name connect return 'offline'; } */ return ($connection); } function protect_data($data) { $data = mysqli_real_escape_string($this->connect_id,$data); return $data; } function get_data($query) { $query = str_replace(array('"NOW()"',"'NOW()'"),'NOW()',$query); // $query = mysqli_real_escape_string($this->connect_id,$query); $this->query = $query; $this->query_count ++; //global $content; //$content .= '<br />I did a query! ' . $query . ' - ' . $this->query_count . '<br />'; if(!($result = @ mysqli_query ($this->connect_id,$query))) { $this->handle_error(); } else { $this->result = $result; $this->insert_id = ''; $this->affected_rows = ''; $this->total_rows = ''; if (substr($query,0,11) == 'INSERT INTO') { $this->insert_id = mysqli_insert_id($this->connect_id); } else if (substr($query,0,6) == 'UPDATE') { $this->affected_rows = mysqli_affected_rows($this->connect_id); } else if (substr($query,0,6) == 'SELECT') { $this->total_rows = mysqli_num_rows($this->result); } return $result; } } function fetch_row($result = '') { $result = $result ? $result : $this->result; return mysqli_fetch_array($result); } function handle_error($error = '') { global $content; $content .= "<br /><br /><b>Error " . mysqli_errno($this->connect_id) . " : ". mysqli_error($this->connect_id) . ' - ' . $this->query . '</b><br /><br />'; return; } function close() { @ mysqli_close($this->connect_id); } } ?> http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/config.php?view=markup&rev=1.1 Index: bugtracker/htdocs/config.php +++ bugtracker/htdocs/config.php <?php //system shunt $database = array( 'type' => 'mysqli', 'host' => 'localhost', 'name' => 'gsoc_bugtracker', 'user' => 'gsoc', 'password' => 'cakedoesrock' ); define('CONFIG_ARRAY','configuration'); define('USER_TABLE','bug_user'); $recaptcha_key = '6LdlXwAAAAAAAA_SQn5B7hqK8bd3mrBERvmbvsZO'; $recaptcha_prv = '6LdlXwAAAAAAAD5Tvwhyk0I2GKVgJE5UonW3oYDY'; if ($database['type'] == 'mysqli') { include($_SERVER['DOCUMENT_ROOT'] . '../includes/database_mysqli.php'); } else { include($_SERVER['DOCUMENTOOT'] . '../includes/database_mysql.php'); } ?>
http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/index/index.php?r1=1.2&r2=1.3&diff_format=u Index: bugtracker/htdocs/index/index.php diff -u bugtracker/htdocs/index/index.php:1.2 bugtracker/htdocs/index/index.php:1.3 --- bugtracker/htdocs/index/index.php:1.2 Thu Jul 10 00:10:05 2008 +++ bugtracker/htdocs/index/index.php Thu Jul 10 20:11:12 2008 @@ -8,7 +8,7 @@ ***********************************************************/ //before we start lets see if the database engine is online -include($_SERVER['DOCUMENT_ROOT'] . '../includes/database.php'); +include($_SERVER['DOCUMENT_ROOT'] . '/config.php'); include($_SERVER['DOCUMENT_ROOT'] . '../includes/functions.php'); //database time @@ -18,7 +18,8 @@ if ($dbtest == 'offline' || !$dbtest) { //arg! were offline - header('Location: /offline.html'); + include($_SERVER['DOCUMENT_ROOT'] . 'offline.html'); + //header('Location: /offline.html'); exit; } @@ -179,5 +180,4 @@ ?> -</body></html> - +</body></html> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/bug.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/bug.php diff -u bugtracker/includes/bug.php:1.1 bugtracker/includes/bug.php:1.2 --- bugtracker/includes/bug.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/bug.php Thu Jul 10 20:11:12 2008 @@ -40,7 +40,15 @@ $bug_data['password'] = md5($bug_data['password']); //add bug - $query = 'INSERT INTO bug (' . implode(', ', array_keys($bug_data)) . ') VALUES ("' . implode('", "', array_values($bug_data)) . '")'; +// $query = 'INSERT INTO bug (' . implode(', ', array_keys($bug_data)) . ') VALUES ("' . implode('", "', array_values($bug_data)) . '")'; + $query = 'INSERT INTO bug (' . implode(', ', array_keys($bug_data)) . ') VALUES ("'; + foreach (array_values($bug_data) as $data) + { + $query .= $db->protect_data($data); + $query .= '","'; + } + $query = substr($query,0,-2); + $query .= ')'; $db->get_data($query); $this->bug_id = $db->insert_id; @@ -68,4 +76,4 @@ } } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cache.php diff -u bugtracker/includes/cache.php:1.1 bugtracker/includes/cache.php:1.2 --- bugtracker/includes/cache.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cache.php Thu Jul 10 20:11:12 2008 @@ -75,9 +75,7 @@ define(strtoupper(str_replace(\' \',\'_\',$data)),$ref); } -?> - -'; +?>'; } else { @@ -90,4 +88,4 @@ } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cachelist.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cachelist.php diff -u bugtracker/includes/cachelist.php:1.1 bugtracker/includes/cachelist.php:1.2 --- bugtracker/includes/cachelist.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cachelist.php Thu Jul 10 20:11:12 2008 @@ -9,4 +9,4 @@ $account_type = array(); $user_data = array(); -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/comment.php?r1=1.2&r2=1.3&diff_format=u Index: bugtracker/includes/comment.php diff -u bugtracker/includes/comment.php:1.2 bugtracker/includes/comment.php:1.3 --- bugtracker/includes/comment.php:1.2 Thu Jul 10 00:10:40 2008 +++ bugtracker/includes/comment.php Thu Jul 10 20:11:12 2008 @@ -18,6 +18,7 @@ } function add_comment($type,$bug_id,$text,$handle) { global $db; + $text = $db->protect_data($text); $query = 'INSERT INTO bug_comment(bug_id,comment_type,comment,handle,added) VALUES ' . "('{$bug_id}', '{$type}', '{$text}', '{$handle}', NOW())"; $db->get_data($query); @@ -58,4 +59,4 @@ } } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/email.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/email.php diff -u bugtracker/includes/email.php:1.1 bugtracker/includes/email.php:1.2 --- bugtracker/includes/email.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/email.php Thu Jul 10 20:11:12 2008 @@ -70,4 +70,4 @@ } } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/functions.php?r1=1.2&r2=1.3&diff_format=u Index: bugtracker/includes/functions.php diff -u bugtracker/includes/functions.php:1.2 bugtracker/includes/functions.php:1.3 --- bugtracker/includes/functions.php:1.2 Thu Jul 10 00:11:45 2008 +++ bugtracker/includes/functions.php Thu Jul 10 20:11:12 2008 @@ -80,11 +80,12 @@ (preg_match('/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/',$email)) ) { $host = explode('@', $email); - if(checkdnsrr($host[1].'.', 'MX') ) return true; - if(checkdnsrr($host[1].'.', 'A') ) return true; - if(checkdnsrr($host[1].'.', 'CNAME') ) return true; +// if(checkdnsrr($host[1].'.', 'MX') ) return true; +// if(checkdnsrr($host[1].'.', 'A') ) return true; +// if(checkdnsrr($host[1].'.', 'CNAME') ) return true; + return true; } return false; } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/recaptchalib.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/recaptchalib.php diff -u bugtracker/includes/recaptchalib.php:1.1 bugtracker/includes/recaptchalib.php:1.2 --- bugtracker/includes/recaptchalib.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/recaptchalib.php Thu Jul 10 20:11:12 2008 @@ -274,4 +274,4 @@ } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/user.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/user.php diff -u bugtracker/includes/user.php:1.1 bugtracker/includes/user.php:1.2 --- bugtracker/includes/user.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/user.php Thu Jul 10 20:11:12 2008 @@ -164,4 +164,4 @@ } } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache/account_type.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cache/account_type.php diff -u bugtracker/includes/cache/account_type.php:1.1 bugtracker/includes/cache/account_type.php:1.2 --- bugtracker/includes/cache/account_type.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cache/account_type.php Thu Jul 10 20:11:12 2008 @@ -8,5 +8,4 @@ define(strtoupper(str_replace(' ','_',$data)),$ref); } -?> - +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache/bug_type.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cache/bug_type.php diff -u bugtracker/includes/cache/bug_type.php:1.1 bugtracker/includes/cache/bug_type.php:1.2 --- bugtracker/includes/cache/bug_type.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cache/bug_type.php Thu Jul 10 20:11:12 2008 @@ -8,5 +8,4 @@ define(strtoupper(str_replace(' ','_',$data)),$ref); } -?> - +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache/comment_type.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cache/comment_type.php diff -u bugtracker/includes/cache/comment_type.php:1.1 bugtracker/includes/cache/comment_type.php:1.2 --- bugtracker/includes/cache/comment_type.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cache/comment_type.php Thu Jul 10 20:11:12 2008 @@ -10,5 +10,4 @@ define(strtoupper(str_replace(' ','_',$data)),$ref); } -?> - +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache/os_version.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cache/os_version.php diff -u bugtracker/includes/cache/os_version.php:1.1 bugtracker/includes/cache/os_version.php:1.2 --- bugtracker/includes/cache/os_version.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cache/os_version.php Thu Jul 10 20:11:12 2008 @@ -8,5 +8,4 @@ define(strtoupper(str_replace(' ','_',$data)),$ref); } -?> - +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache/php_version.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cache/php_version.php diff -u bugtracker/includes/cache/php_version.php:1.1 bugtracker/includes/cache/php_version.php:1.2 --- bugtracker/includes/cache/php_version.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cache/php_version.php Thu Jul 10 20:11:12 2008 @@ -14,5 +14,4 @@ define(strtoupper(str_replace(' ','_',$data)),$ref); } -?> - +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache/status.php?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/includes/cache/status.php diff -u bugtracker/includes/cache/status.php:1.1 bugtracker/includes/cache/status.php:1.2 --- bugtracker/includes/cache/status.php:1.1 Wed Jul 9 13:07:22 2008 +++ bugtracker/includes/cache/status.php Thu Jul 10 20:11:12 2008 @@ -8,5 +8,4 @@ define(strtoupper(str_replace(' ','_',$data)),$ref); } -?> - +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/index.php?r1=1.2&r2=1.3&diff_format=u Index: bugtracker/template/generic/bug/index.php diff -u bugtracker/template/generic/bug/index.php:1.2 bugtracker/template/generic/bug/index.php:1.3 --- bugtracker/template/generic/bug/index.php:1.2 Thu Jul 10 00:12:20 2008 +++ bugtracker/template/generic/bug/index.php Thu Jul 10 20:11:12 2008 @@ -19,7 +19,11 @@ if ($db->total_rows) { //lets shunt out a text file - echo 'here be a forced download of a text file, well sorta...'; + header("Cache-Control: no-cache, must-revalidate"); + header("Content-Type: text/plain"); + header('Content-Disposition: attachment; filename="bug_reproduce_code_bugid_' . $bug_id . '.txt"'); + $file = $db->fetch_row(); + echo $file['comment']; exit; } else @@ -190,4 +194,4 @@ } } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/bugtracker/includes/database_mysql.php?view=markup&rev=1.1 Index: bugtracker/includes/database_mysql.php +++ bugtracker/includes/database_mysql.php <?php //class class db { public $query_count = 0; function test_connect() { global $database; $this->host = $database['host']; $this->name = $database['name']; $this->user = $database['user']; $this->pass = $database['password']; if (!($connection = @ mysql_connect($database['host'], $database['user'], $database['password']))) { return 'offline'; } $this->connect_id = $connection; if (! @ mysql_select_db($this->name)) { //no db name connect return 'offline'; } return ($connection); } function protect_data($data) { //$data = mysqli_real_escape_string($this->connect_id,$data); return $data; } function get_data($query) { $query = str_replace(array('"NOW()"',"'NOW()'"),'NOW()',$query); $this->query = $query; $this->query_count ++; //global $content; //$content .= '<br />I did a query! ' . $query . ' - ' . $this->query_count . '<br />'; if(!($result = @ mysql_query ($query, $this->connect_id))) { $this->handle_error(); } else { $this->result = $result; $this->insert_id = ''; $this->affected_rows = ''; $this->total_rows = ''; if (substr($query,0,11) == 'INSERT INTO') { $this->insert_id = mysql_insert_id($this->connect_id); } else if (substr($query,0,6) == 'UPDATE') { $this->affected_rows = mysql_affected_rows($this->connect_id); } else if (substr($query,0,6) == 'SELECT') { $this->total_rows = mysql_num_rows($this->result); } return $result; } } function fetch_row($result = '') { $result = $result ? $result : $this->result; return mysql_fetch_array($result); } function handle_error($error = '') { global $content; $content .= "<br /><br /><b>Error " . mysql_errno() . " : ". mysql_error() . ' - ' . $this->query . '</b><br /><br />'; return; } function close() { @ mysql_close($this->connect_id); } } //////////////////////////////////////////////////////////////////////////// /* function getdata($query) { //make a database connection global $database; if (!($connection = @ mysql_connect($database['host'], $database['user'], $database['password']))) { return "offline"; } else { if (!(mysql_select_db($database['name']))) showerror(); if(!($result = @ mysql_query ($query, $connection))) showerror(); } return $result; } function showerror() { print("Error " . mysql_errno() . " : ". mysql_error()); } */ ?> http://cvs.php.net/viewvc.cgi/bugtracker/includes/database_mysqli.php?view=markup&rev=1.1 Index: bugtracker/includes/database_mysqli.php +++ bugtracker/includes/database_mysqli.php <?php //class class db { public $query_count = 0; function test_connect() { global $database; $this->host = $database['host']; $this->name = $database['name']; $this->user = $database['user']; $this->pass = $database['password']; if (!($connection = mysqli_connect($database['host'], $database['user'], $database['password'], $database['name']))) { return 'offline'; } $this->connect_id = $connection; /* if (! @ mysqli_select_db($this->name)) { //no db name connect return 'offline'; } */ return ($connection); } function protect_data($data) { $data = mysqli_real_escape_string($this->connect_id,$data); return $data; } function get_data($query) { $query = str_replace(array('"NOW()"',"'NOW()'"),'NOW()',$query); // $query = mysqli_real_escape_string($this->connect_id,$query); $this->query = $query; $this->query_count ++; //global $content; //$content .= '<br />I did a query! ' . $query . ' - ' . $this->query_count . '<br />'; if(!($result = @ mysqli_query ($this->connect_id,$query))) { $this->handle_error(); } else { $this->result = $result; $this->insert_id = ''; $this->affected_rows = ''; $this->total_rows = ''; if (substr($query,0,11) == 'INSERT INTO') { $this->insert_id = mysqli_insert_id($this->connect_id); } else if (substr($query,0,6) == 'UPDATE') { $this->affected_rows = mysqli_affected_rows($this->connect_id); } else if (substr($query,0,6) == 'SELECT') { $this->total_rows = mysqli_num_rows($this->result); } return $result; } } function fetch_row($result = '') { $result = $result ? $result : $this->result; return mysqli_fetch_array($result); } function handle_error($error = '') { global $content; $content .= "<br /><br /><b>Error " . mysqli_errno($this->connect_id) . " : ". mysqli_error($this->connect_id) . ' - ' . $this->query . '</b><br /><br />'; return; } function close() { @ mysqli_close($this->connect_id); } } ?> http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/config.php?view=markup&rev=1.1 Index: bugtracker/htdocs/config.php +++ bugtracker/htdocs/config.php <?php //system shunt $database = array( 'type' => 'mysqli', 'host' => 'localhost', 'name' => 'gsoc_bugtracker', 'user' => 'gsoc', 'password' => 'cakedoesrock' ); define('CONFIG_ARRAY','configuration'); define('USER_TABLE','bug_user'); $recaptcha_key = '6LdlXwAAAAAAAA_SQn5B7hqK8bd3mrBERvmbvsZO'; $recaptcha_prv = '6LdlXwAAAAAAAD5Tvwhyk0I2GKVgJE5UonW3oYDY'; if ($database['type'] == 'mysqli') { include($_SERVER['DOCUMENT_ROOT'] . '../includes/database_mysqli.php'); } else { include($_SERVER['DOCUMENTOOT'] . '../includes/database_mysql.php'); } ?>