summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-05-27 08:28:56 -0300
committerRenato Botelho <garga@FreeBSD.org>2013-05-27 08:28:56 -0300
commitaa57f965b65fea175c270ec1d7ed05464ed76d14 (patch)
tree2e423ba0c3e4597447298d130899349d7abdb7e8
parentc82dcc1d3bafa91b6b4866f2c65ded717e161a2e (diff)
downloadpfsense-aa57f965b65fea175c270ec1d7ed05464ed76d14.zip
pfsense-aa57f965b65fea175c270ec1d7ed05464ed76d14.tar.gz
Last element is always empty, be sure we drop it
-rw-r--r--etc/inc/pfsense-utils.inc3
1 files changed, 2 insertions, 1 deletions
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;
}
OpenPOWER on IntegriCloud