From ef637a7c7760cfd4354b8ed97e1f495edcda5cba Mon Sep 17 00:00:00 2001 From: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com> Date: Thu, 11 Jul 2019 06:23:45 +0200 Subject: [PATCH] API Transport - Empty lines handling (#10431) * API Transport - Empty lines handling * Handle empty lines * Update Api.php --- LibreNMS/Alert/Transport/Api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibreNMS/Alert/Transport/Api.php b/LibreNMS/Alert/Transport/Api.php index f4eab854d5..0d9ae359e3 100644 --- a/LibreNMS/Alert/Transport/Api.php +++ b/LibreNMS/Alert/Transport/Api.php @@ -48,7 +48,7 @@ class Api extends Transport $host = explode("?", $api, 2)[0]; //we don't use the parameter part, cause we build it out of options. //get each line of key-values and process the variables; - foreach (preg_split("/\\r\\n|\\r|\\n/", $options) as $current_line) { + foreach (preg_split("/\\r\\n|\\r|\\n/", $options, -1, PREG_SPLIT_NO_EMPTY) as $current_line) { list($u_key, $u_val) = explode('=', $current_line, 2); // Replace the values