From a8eaedc817f9341dbbada1bb60ee0803889e371e Mon Sep 17 00:00:00 2001
From: TimZ99 <TimZ99@users.noreply.github.com>
Date: Mon, 30 Sep 2019 17:50:20 +0200
Subject: [PATCH 1/2] Fixed undefined index

Fixes #787.
---
 src/psm/Util/Server/Updater/StatusUpdater.php | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/psm/Util/Server/Updater/StatusUpdater.php b/src/psm/Util/Server/Updater/StatusUpdater.php
index eca510e1..9588d4aa 100644
--- a/src/psm/Util/Server/Updater/StatusUpdater.php
+++ b/src/psm/Util/Server/Updater/StatusUpdater.php
@@ -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;

From 56587826a3f36c2772e5088a574918951bd44902 Mon Sep 17 00:00:00 2001
From: TimZ99 <TimZ99@users.noreply.github.com>
Date: Mon, 30 Sep 2019 17:59:24 +0200
Subject: [PATCH 2/2] Bumped version to 3.4.5

---
 CHANGELOG.rst                  | 5 +++++
 README.rst                     | 3 +--
 docs/conf.py                   | 2 +-
 src/includes/psmconfig.inc.php | 2 +-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 6e7eb849..bd10a7d9 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -6,6 +6,11 @@ Not yet released
 ----------------
 \-
 
+v3.4.5 (released September 30, 2019)
+------------------------------------
+
+* a8eaedc8: Fixed undefined index last_output.
+
 v3.4.4 (released September 26, 2019)
 ------------------------------------
 
diff --git a/README.rst b/README.rst
index 6cc52a57..d0a633ee 100755
--- a/README.rst
+++ b/README.rst
@@ -5,8 +5,7 @@ PHP Server Monitor
    :alt: Join the chat at https://gitter.im/erickrf/nlpnet
    :target: https://gitter.im/phpservermon/phpservermon
 
-Version 3.4.4 (Updated design!)
-
+Version 3.4.5
 
 PHP Server Monitor is a script that checks whether your websites and servers are up and running.
 It comes with a web based user interface where you can manage your services and websites,
diff --git a/docs/conf.py b/docs/conf.py
index aee0af61..266839e9 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -51,7 +51,7 @@ copyright = u'2008-2017, Pepijn Over'
 # built documents.
 #
 # The short X.Y version.
-version = '3.4.4'
+version = '3.4.5'
 # The full version, including alpha/beta/rc tags.
 release = version
 
diff --git a/src/includes/psmconfig.inc.php b/src/includes/psmconfig.inc.php
index 56cc60ad..3b2830d0 100644
--- a/src/includes/psmconfig.inc.php
+++ b/src/includes/psmconfig.inc.php
@@ -29,7 +29,7 @@
 /**
  * Current PSM version
  */
-define('PSM_VERSION', '3.4.4');
+define('PSM_VERSION', '3.4.5');
 
 /**
  * URL to check for updates. Will not be checked if turned off on config page.