Handle when there isn't a server Id

This commit is contained in:
Isaac Connor 2021-03-22 21:30:56 -04:00
parent e0893ef7ab
commit 7743445323
1 changed files with 2 additions and 1 deletions

View File

@ -169,7 +169,8 @@ function queryRequest() {
foreach ( $results as $row ) {
$row['DateTime'] = strftime('%Y-%m-%d %H:%M:%S', intval($row['TimeKey']));
$Server = ZM\Server::find_one(array('Id'=>$row['ServerId']));
$row['Server'] = $Server->Name();
$row['Server'] = $Server ? $Server->Name() : '';
// First strip out any html tags
// Second strip out all characters that are not ASCII 32-126 (yes, 126)
$row['Message'] = preg_replace('/[^\x20-\x7E]/', '', strip_tags($row['Message']));