<?php
/***************************************************************************
- * Copyright (C) 2003-2007 Polytechnique.org *
+ * Copyright (C) 2003-2008 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
private function fixCharset($action)
{
- return is_utf8($action) ? $action : utf8_encode($action);
+ if (!is_string($action)) {
+ return $action;
+ } else {
+ return is_utf8($action) ? $action : utf8_encode($action);
+ }
}
private function add(array &$entry, $sizef = 'rows', $timef = 'exectime', $errorf = 'error')
unset($entry[$timef]);
$trace['rows'] = @$entry[$sizef];
unset($entry[$sizef]);
- $trace['error'] = @$entry[$errorf];
+ $trace['error'] = $this->fixCharset(@$entry[$errorf]);
unset($entry[$errorf]);
if ($trace['error']) {
$this->error = true;
}
- $trace['data'] = array($entry);
+ $trace['data'] = array($this->fixCharset($entry));
$this->traces[] =& $trace;
}
{
$trace =& $this->traces[count($this->traces) - 1];
$trace['rows'] = $rows;
- $trace['error'] = $error;
+ $trace['error'] = $this->fixCharset($error);
+ array_walk_recursive($userdata, array($this, 'fixCharset'));
$trace['data'] = $userdata;
if ($trace['error']) {
$this->error = true;