diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-03-20 01:32:57 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-03-20 01:32:57 +0000 |
commit | 115a2cc9e0bb3345ccfbb25134a6f54e96c4e8f9 (patch) | |
tree | 633cd13186e4bf1094f8b0a8bf96ea29359eb9a1 /phpBB/includes/db | |
parent | 229242acf52621d91ef3df8d82af5ab74edbc60b (diff) | |
download | forums-115a2cc9e0bb3345ccfbb25134a6f54e96c4e8f9.tar forums-115a2cc9e0bb3345ccfbb25134a6f54e96c4e8f9.tar.gz forums-115a2cc9e0bb3345ccfbb25134a6f54e96c4e8f9.tar.bz2 forums-115a2cc9e0bb3345ccfbb25134a6f54e96c4e8f9.tar.xz forums-115a2cc9e0bb3345ccfbb25134a6f54e96c4e8f9.zip |
And from the flames rose the might phoenix ... well, a little crisp around the edges with the odd missing feather ...
git-svn-id: file:///svn/phpbb/trunk@3688 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db')
-rw-r--r-- | phpBB/includes/db/firebird.php | 27 |
1 files changed, 14 insertions, 13 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 = '') |