Fixed undefined index

Fixes #787.
This commit is contained in:
TimZ99 2019-09-30 17:50:20 +02:00
parent 86b75c3068
commit a8eaedc817
No known key found for this signature in database
GPG Key ID: 4D8268DC68E8339D
1 changed files with 1 additions and 10 deletions

View File

@ -126,7 +126,7 @@ class StatusUpdater {
// if the server is on, add the last_online value and reset the error threshold counter
$save['status'] = 'on';
$save['last_online'] = date('Y-m-d H:i:s');
$save['last_output'] = $this->header;
$save['last_output'] = substr($this->header,0,5000);
$save['warning_threshold_counter'] = 0;
if ($this->server['status'] == 'off') {
$online_date = new \DateTime($save['last_online']);
@ -152,15 +152,6 @@ class StatusUpdater {
}
}
}
// PATCH Arkhee: fix/last-online-stuck-on-never-if-webpage-too-large
// Updating table "servers" does not work
// Symptom: "Last online" stays stuck on "never"
// Reason: last_output contains the full webpage, too long for the query
// This may depend on mysql configuration on the server_, explaining why some have the problem or not
// Field is 255 Chars, and request does not work anyway is loaded web page is too large in last_output
// Solution: updated column to text and truncate to 5000 characters or less before the query
$save["last_output"] = substr($save["last_output"],0,5000);
// End PATCH
$this->db->save(PSM_DB_PREFIX.'servers', $save, array('server_id' => $this->server_id));
return $this->status_new;