From aa57f965b65fea175c270ec1d7ed05464ed76d14 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 27 May 2013 08:28:56 -0300 Subject: Last element is always empty, be sure we drop it --- etc/inc/pfsense-utils.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 7d93811..15ba42b 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1472,7 +1472,8 @@ function add_hostname_to_watch($hostname) { } } file_put_contents("/var/db/dnscache/$hostname", $contents); - $result = explode("\n", $contents); + /* Remove empty elements */ + $result = array_filter(explode("\n", $contents), 'strlen'); } return $result; } -- cgit v1.1