Skip to content

Empty message preview when timeline is available and message is an array #1053

@parallels999

Description

@parallels999

when timeline is available and message is an array, $messageText = '';

if ($this->hasTimeDataCollector()) {
$this->addTimeMeasure("[{$label}]: " . substr($messageText, 0, 100), microtime(true));
}

For the preview. 100 first chars are used substr($messageText, 0, 100), but when is an array, $messageText is empty

$isString = is_string($message);
if ($this->isJsonVarDumperUsed()) {
$messageJson = $messageText;
$messageText = '';
} elseif ($this->isHtmlVarDumperUsed()) {
$messageHtml = $messageText;
if ($this->compactDumps) {
$messageHtml = $this->compactMessageDump($messageHtml);
}
$messageText = '';
}

possible solution?

substr($messageText ?: json_encode($messageJson, JSON_INVALID_UTF8_SUBSTITUTE), 0, 100)

Is this expected behavior? There was a preview before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions