update v1.0.7.9 R.C.
This is a Release Candidate. We are still testing.
This commit is contained in:
19
vendor/sebastian/exporter/src/Exporter.php
vendored
19
vendor/sebastian/exporter/src/Exporter.php
vendored
@@ -89,11 +89,10 @@ class Exporter
|
||||
* Exports a value into a single-line string
|
||||
*
|
||||
* The output of this method is similar to the output of
|
||||
* SebastianBergmann\Exporter\Exporter::export. This method guarantees
|
||||
* thought that the result contains now newlines.
|
||||
* SebastianBergmann\Exporter\Exporter::export().
|
||||
*
|
||||
* Newlines are replaced by the visible string '\n'. Contents of arrays
|
||||
* and objects (if any) are replaced by '...'.
|
||||
* Newlines are replaced by the visible string '\n'.
|
||||
* Contents of arrays and objects (if any) are replaced by '...'.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return string
|
||||
@@ -104,8 +103,14 @@ class Exporter
|
||||
if (is_string($value)) {
|
||||
$string = $this->export($value);
|
||||
|
||||
if (strlen($string) > 40) {
|
||||
$string = substr($string, 0, 30) . '...' . substr($string, -7);
|
||||
if (function_exists('mb_strlen')) {
|
||||
if (mb_strlen($string) > 40) {
|
||||
$string = mb_substr($string, 0, 30) . '...' . mb_substr($string, -7);
|
||||
}
|
||||
} else {
|
||||
if (strlen($string) > 40) {
|
||||
$string = substr($string, 0, 30) . '...' . substr($string, -7);
|
||||
}
|
||||
}
|
||||
|
||||
return str_replace("\n", '\n', $string);
|
||||
@@ -225,7 +230,7 @@ class Exporter
|
||||
|
||||
if (is_string($value)) {
|
||||
// Match for most non printable chars somewhat taking multibyte chars into account
|
||||
if (preg_match('/[^\x09-\x0d\x20-\xff]/', $value)) {
|
||||
if (preg_match('/[^\x09-\x0d\x1b\x20-\xff]/', $value)) {
|
||||
return 'Binary String: 0x' . bin2hex($value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user