summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/pfsense-utils.inc
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2016-05-31 18:26:36 -0500
committerChris Buechler <cmb@pfsense.org>2016-05-31 18:26:36 -0500
commit1464554932197a04cb35702196d3b2407956e618 (patch)
treed7fba5aa21ac4984326ff07204c3dc0d54fe7bd5 /src/etc/inc/pfsense-utils.inc
parent92da593a95031ace5bea2bd6192d7239ea95e9f7 (diff)
downloadpfsense-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.inc5
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;
OpenPOWER on IntegriCloud