From d19d64792600563df14952b6facba36017d9e9dc Mon Sep 17 00:00:00 2001 From: misol Date: Sat, 31 Oct 2009 14:30:03 +0000 Subject: [PATCH] When encoding of error string is not UTF-8, there was a trouble to read. This revision fixes the encoding trouble and refines code related to error displaying on database class file. git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6905 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/db/DB.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/db/DB.class.php b/classes/db/DB.class.php index 3640eee06..9ad440626 100644 --- a/classes/db/DB.class.php +++ b/classes/db/DB.class.php @@ -226,6 +226,7 @@ * @return object of error **/ function getError() { + $this->errstr = Context::convertEncodingStr($this->errstr); return new Object($this->errno, $this->errstr); } @@ -326,7 +327,7 @@ break; } - if($this->errno != 0 ) $output = new Object($this->errno, $this->errstr); + if($this->isError()) $output = $this->getError(); else if(!is_a($output, 'Object') && !is_subclass_of($output, 'Object')) $output = new Object(); $output->add('_query', $this->query); $output->add('_elapsed_time', sprintf("%0.5f", $this->elapsed_time));