projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix PlErrorReport::fromCSV by adding a missing static
[platal.git]
/
classes
/
plbacktrace.php
diff --git
a/classes/plbacktrace.php
b/classes/plbacktrace.php
index
2f18f7a
..
729765b
100644
(file)
--- a/
classes/plbacktrace.php
+++ b/
classes/plbacktrace.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-20
07
Polytechnique.org *
+ * Copyright (C) 2003-20
11
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-39,7
+39,11
@@
class PlBacktrace
private function fixCharset($action)
{
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')
}
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]);
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;
}
unset($entry[$errorf]);
if ($trace['error']) {
$this->error = true;
}
- $trace['data'] = array($
entry
);
+ $trace['data'] = array($
this->fixCharset($entry)
);
$this->traces[] =& $trace;
}
$this->traces[] =& $trace;
}
@@
-90,7
+94,8
@@
class PlBacktrace
{
$trace =& $this->traces[count($this->traces) - 1];
$trace['rows'] = $rows;
{
$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;
$trace['data'] = $userdata;
if ($trace['error']) {
$this->error = true;