Fix an exception in viewer, when client had an empty away message
This commit is contained in:
parent
c751001c61
commit
9a5e05ca84
|
@ -220,11 +220,12 @@ EOD;
|
||||||
$clientName = implode(" ", $beforeName); // prefix groups
|
$clientName = implode(" ", $beforeName); // prefix groups
|
||||||
$clientName .= " {$client["client_nickname"]} "; // nickname
|
$clientName .= " {$client["client_nickname"]} "; // nickname
|
||||||
$clientName .= implode(" ", $afterName); // suffix groups
|
$clientName .= implode(" ", $afterName); // suffix groups
|
||||||
$clientName = Utils::escape(trim($clientName)); // trim and sanitize
|
$clientName = Utils::escape(trim($clientName)); // trim and sanitize
|
||||||
|
|
||||||
$this->add(
|
$this->add(
|
||||||
$html,
|
$html,
|
||||||
$isQuery ? " is-query" : "", $client["client_database_id"],
|
$isQuery ? " is-query" : "",
|
||||||
|
$client["client_database_id"],
|
||||||
$clientIcon,
|
$clientIcon,
|
||||||
$clientName,
|
$clientName,
|
||||||
$suffixIcons
|
$suffixIcons
|
||||||
|
@ -284,7 +285,13 @@ EOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($client["client_away"]) {
|
if($client["client_away"]) {
|
||||||
return $this->getIcon("away.svg", Utils::escape($client["client_away_message"]) ?: __get("VIEWER_CLIENT_AWAY"));
|
if ($client["client_away_message"] !== null) {
|
||||||
|
$awayTooltip = Utils::escape($client["client_away_message"]);
|
||||||
|
} else {
|
||||||
|
$awayTooltip = __get("VIEWER_CLIENT_AWAY");
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->getIcon("away.svg", $awayTooltip);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$client["client_output_hardware"]) {
|
if(!$client["client_output_hardware"]) {
|
||||||
|
|
Loading…
Reference in New Issue