diff options
author | Chris Buechler <cmb@pfsense.org> | 2016-05-31 18:26:36 -0500 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2016-05-31 18:26:36 -0500 |
commit | 1464554932197a04cb35702196d3b2407956e618 (patch) | |
tree | d7fba5aa21ac4984326ff07204c3dc0d54fe7bd5 /src/etc/inc/pfsense-utils.inc | |
parent | 92da593a95031ace5bea2bd6192d7239ea95e9f7 (diff) | |
download | pfsense-1464554932197a04cb35702196d3b2407956e618.zip pfsense-1464554932197a04cb35702196d3b2407956e618.tar.gz |
Add a check to see if the file exists before running filesize on it, to avoid PHP error.
Diffstat (limited to 'src/etc/inc/pfsense-utils.inc')
-rw-r--r-- | src/etc/inc/pfsense-utils.inc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc index 0fc8bf5..96561c3 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; |