X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fplbacktrace.php;h=e15a304b4921d4fe57e3d2eb5463a2b4086b4f09;hb=44837f0200b687b01145e5a7b984830152dcd57d;hp=2f18f7a151a7f4230fcf61500d33b2d6684f364d;hpb=9e1b43206453894a404ca1c0458423ece6811043;p=platal.git diff --git a/classes/plbacktrace.php b/classes/plbacktrace.php index 2f18f7a..e15a304 100644 --- a/classes/plbacktrace.php +++ b/classes/plbacktrace.php @@ -39,7 +39,11 @@ class PlBacktrace 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') @@ -52,12 +56,12 @@ class PlBacktrace 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; } @@ -90,7 +94,8 @@ class PlBacktrace { $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;