Removed last offline duration parentheses if empty (#641)

This commit is contained in:
Tim 2018-09-05 21:46:18 +02:00 committed by TimZ99
parent de29906f27
commit 132a730d71
No known key found for this signature in database
GPG Key ID: 4D8268DC68E8339D
2 changed files with 3 additions and 1 deletions

View File

@ -5,6 +5,7 @@ Changelog
Not yet released
----------------
* #640: Removed () after last offline value when the last offline duration is unknown.
* #637: Added php extensions to composer required list, spelling fixes in changelog and composer update.
* #635: Changed server order on ?&mod=user&action=edit&id=x.
* #634: Changed ' to " in sql query, both were used.

View File

@ -107,7 +107,8 @@ abstract class AbstractServerController extends AbstractController {
$server['last_online'] = psm_timespan($server['last_online']);
$server['last_offline'] = psm_timespan($server['last_offline']);
if ($server['last_offline'] != psm_get_lang('system', 'never')) {
$server['last_offline_duration'] = "(".$server['last_offline_duration'].")";
$server['last_offline_duration'] = is_null($server['last_offline_duration']) ?
null : "(".$server['last_offline_duration'].")";
}
$server['last_check'] = psm_timespan($server['last_check']);
$server['active'] = psm_get_lang('system', $server['active']);