From c25c67149283270ad005b2c4f22d17c455c95eb2 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Tue, 31 May 2016 18:26:36 -0500 Subject: Add a check to see if the file exists before running filesize on it, to avoid PHP error. --- src/etc/inc/pfsense-utils.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc index 066d9d7..98447f0 100644 --- a/src/etc/inc/pfsense-utils.inc +++ b/src/etc/inc/pfsense-utils.inc @@ -1929,6 +1929,11 @@ function parse_aliases_file($filename, $type = "url", $max_items = -1, $kflc = f * RETURNS an array of ip subnets and ip's or ports and port-ranges, returns NULL upon a error conditions (file not found) */ + if (!file_exists($filename)) { + log_error(sprintf(gettext("Could not process non-existent file from alias: %s"), $filename)); + return null; + } + if (filesize($filename) == 0) { log_error(sprintf(gettext("Could not process empty file from alias: %s"), $filename)); return null; -- cgit v1.1