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:28:00 -0500 |
commit | c25c67149283270ad005b2c4f22d17c455c95eb2 (patch) | |
tree | be4e8e884089f7846b981230b39c4a51e9a707f6 /src/etc | |
parent | 20f46e77331b6b8ac3135e57339aeed11bb5b96c (diff) | |
download | pfsense-c25c67149283270ad005b2c4f22d17c455c95eb2.zip pfsense-c25c67149283270ad005b2c4f22d17c455c95eb2.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')
-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 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; |