Project

General

Profile

« Previous | Next » 

Revision c25c6714

Added by Chris Buechler about 9 years ago

Add a check to see if the file exists before running filesize on it, to avoid PHP error.

View differences:

src/etc/inc/pfsense-utils.inc
1929 1929
	 * RETURNS an array of ip subnets and ip's or ports and port-ranges, returns NULL upon a error conditions (file not found)
1930 1930
	 */
1931 1931

  
1932
	if (!file_exists($filename)) {
1933
		log_error(sprintf(gettext("Could not process non-existent file from alias: %s"), $filename));
1934
		return null;
1935
	}
1936

  
1932 1937
	if (filesize($filename) == 0) {
1933 1938
		log_error(sprintf(gettext("Could not process empty file from alias: %s"), $filename));
1934 1939
		return null;

Also available in: Unified diff