diff options
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/db/firebird.php | 27 | ||||
-rw-r--r-- | phpBB/install/schemas/firebird_schema.sql | 32 |
2 files changed, 30 insertions, 29 deletions
diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 9309a7dfab..2394704bc3 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -32,8 +32,8 @@ class sql_db var $transaction = false; var $sql_report = ''; var $sql_time = 0; - var $escape_max = array('match' => array('\\', '\'', '"'), 'replace' => array('\\\\', '\'\'', '\"')); - var $escape_min = array('match' => array('\\', '"'), 'replace' => array('\\\\', '\"')); + var $escape_max = array('match' => array("\0", '\\', '\'', '"'), 'replace' => array('\\0', '\\\\', '\'\'', '\"')); + var $escape_min = array('match' => array("\0", '\\', '"'), 'replace' => array('\\0', '\\\\', '\"')); // Constructor function sql_db($sqlserver, $sqluser, $sqlpassword, $database = '', $port = '', $persistency = false) @@ -46,7 +46,7 @@ class sql_db $this->password = $sqlpassword; $this->server = $sqlserver; - $this->db_connect_id =($this->persistency) ? @ibase_pconnect($this->server, $this->user, $this->password) : @ibase_connect($this->server, $this->user, $this->password); + $this->db_connect_id =($this->persistency) ? ibase_pconnect($this->server, $this->user, $this->password) : ibase_connect($this->server, $this->user, $this->password); return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); } @@ -130,16 +130,11 @@ class sql_db $curtime = $curtime[0] + $curtime[1] - $starttime; } - if (!($this->query_result = @ibase_query($query, $this->db_connect_id))) + if (($this->query_result = ibase_query($query, $this->db_connect_id)) === FALSE) { $this->sql_error($query); } - if (!$this->transaction) - { - @ibase_commit(); - } - if (!empty($_GET['explain'])) { $endtime = explode(' ', microtime()); @@ -211,7 +206,7 @@ class sql_db $this->query_result = false; $this->num_queries++; - echo $query = 'SELECT FIRST ' . $total .((!empty($offset)) ? ' SKIP ' . $offset : '') . substr($query, 6); + $query = 'SELECT FIRST ' . $total . ((!empty($offset)) ? ' SKIP ' . $offset : '') . substr($query, 6); return $this->sql_query($query, $expire_time); } @@ -302,7 +297,12 @@ class sql_db return $cache->sql_fetchrow($query_id); } - return ($query_id) ? get_object_vars(@ibase_fetch_object($query_id)) : false; + $row = array(); + foreach (get_object_vars(ibase_fetch_object($query_id, IBASE_TEXT)) as $key => $value) + { + $row[strtolower($key)] = trim(str_replace("\\0", "\0", str_replace("\\n", "\n", $value))); + } + return ($query_id) ? $row : false; } function sql_fetchrowset($query_id = 0) @@ -311,11 +311,12 @@ class sql_db { $query_id = $this->query_result; } + if ($query_id) { unset($this->rowset[$query_id]); unset($this->row[$query_id]); - while($this->rowset[$query_id] = get_object_vars(@ibase_fetch_object($query_id))) + while($this->rowset[$query_id] = get_object_vars(@ibase_fetch_object($query_id, IBASE_TEXT ))) { $result[] = $this->rowset[$query_id]; } @@ -417,7 +418,7 @@ class sql_db function sql_escape($msg) { - return (@ini_get('magic_quotes_sybase') || strtoupper(@ini_get('magic_quotes_sybase')) == 'ON') ? str_replace($this->replace_min['match'], $this->replace_min['replace'], $msg) : str_replace($this->replace_max['match'], $this->replace_max['replace'], $msg); + return (@ini_get('magic_quotes_sybase') || strtoupper(@ini_get('magic_quotes_sybase')) == 'ON') ? str_replace($this->replace_min['match'], $this->replace_min['replace'], stripslashes($msg)) : str_replace($this->replace_max['match'], $this->replace_max['replace'], stripslashes($msg)); } function sql_error($sql = '') diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 2dfe4f7324..5ccfd80bf7 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -208,12 +208,12 @@ CREATE TABLE phpbb_forums ( forum_last_post_id INTEGER DEFAULT 0 NOT NULL, forum_last_poster_id INTEGER DEFAULT 0 NOT NULL, forum_last_post_time INTEGER DEFAULT 0 NOT NULL, - forum_last_poster_name VARCHAR(30), + forum_last_poster_name VARCHAR(30) DEFAULT '' NOT NULL, display_on_index SMALLINT DEFAULT 1 NOT NULL, enable_icons SMALLINT DEFAULT 1 NOT NULL, enable_prune SMALLINT DEFAULT 0 NOT NULL, - prune_next INTEGER, - prune_days SMALLINT NOT NULL, + prune_next INTEGER DEFAULT 0 NOT NULL, + prune_days SMALLINT DEFAULT 0 NOT NULL, prune_freq SMALLINT DEFAULT 0 NOT NULL, PRIMARY KEY (forum_id) ); @@ -252,13 +252,13 @@ CREATE INDEX phpbb_forums_watch_status ON phpbb_forums_watch (notify_status); CREATE TABLE phpbb_groups ( group_id INTEGER NOT NULL, group_type SMALLINT DEFAULT 1 NOT NULL, - group_name VARCHAR(40) NOT NULL, + group_name VARCHAR(40) DEFAULT '' NOT NULL, group_display SMALLINT DEFAULT 0 NOT NULL, - group_avatar VARCHAR(100), - group_avatar_type SMALLINT, - group_rank INTEGER DEFAULT 0, + group_avatar VARCHAR(100) DEFAULT '' NOT NULL, + group_avatar_type SMALLINT DEFAULT 0 NOT NULL, + group_rank INTEGER DEFAULT 0 NOT NULL, group_colour VARCHAR(6) DEFAULT '' NOT NULL, - group_description VARCHAR(255) NOT NULL, + group_description VARCHAR(255) DEFAULT '' NOT NULL, PRIMARY KEY (group_id) ); @@ -462,7 +462,7 @@ CREATE TABLE phpbb_posts ( poster_id INTEGER DEFAULT 0 NOT NULL, attach_id INTEGER DEFAULT 0 NOT NULL, icon_id SMALLINT DEFAULT 1 NOT NULL, - poster_ip VARCHAR(40) NOT NULL, + poster_ip VARCHAR(40) DEFAULT '' NOT NULL, post_time INTEGER DEFAULT 0 NOT NULL, post_approved SMALLINT DEFAULT 1 NOT NULL, post_reported SMALLINT DEFAULT 0 NOT NULL, @@ -471,14 +471,14 @@ CREATE TABLE phpbb_posts ( enable_smilies SMALLINT DEFAULT 1 NOT NULL, enable_magic_url SMALLINT DEFAULT 1 NOT NULL, enable_sig SMALLINT DEFAULT 1 NOT NULL, - post_username VARCHAR(30), - post_subject VARCHAR(60), - post_text BLOB SUB_TYPE 1, - post_checksum VARCHAR(32) NOT NULL, + post_username VARCHAR(30) DEFAULT '', + post_subject VARCHAR(60) DEFAULT '', + post_text BLOB SUB_TYPE 1 DEFAULT '' NOT NULL, + post_checksum VARCHAR(32) DEFAULT '' NOT NULL, post_encoding VARCHAR(11) DEFAULT 'iso-8859-15' NOT NULL, bbcode_bitfield INTEGER DEFAULT 0 NOT NULL, - bbcode_uid VARCHAR(10) NOT NULL, - post_edit_time INTEGER, + bbcode_uid VARCHAR(10) DEFAULT '' NOT NULL, + post_edit_time INTEGER DEFAULT 0 NOT NULL, post_edit_count SMALLINT DEFAULT 0 NOT NULL, PRIMARY KEY (post_id) ); @@ -892,7 +892,7 @@ CREATE TABLE phpbb_topics ( topic_last_poster_name VARCHAR(30), topic_last_post_time INTEGER DEFAULT 0 NOT NULL, topic_moved_id INTEGER DEFAULT 0 NOT NULL, - poll_title VARCHAR(255) NOT NULL, + poll_title VARCHAR(255) DEFAULT '' NOT NULL, poll_start INTEGER DEFAULT 0 NOT NULL, poll_length INTEGER DEFAULT 0 NOT NULL, poll_last_vote INTEGER, |