mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 18:59:48 +01:00
Error handling in savesettings.php
This is to address https://github.com/pi-hole/pi-hole/issues/2444 Signed-off-by: Cynthia Revstrom <me@cynthia.re>
This commit is contained in:
committed by
Cynthia Revstrom
parent
af8c926cef
commit
34bbb9a70e
@@ -63,7 +63,15 @@ function readStaticLeasesFile()
|
||||
{
|
||||
global $dhcp_static_leases;
|
||||
$dhcp_static_leases = array();
|
||||
$dhcpstatic = @fopen('/etc/dnsmasq.d/04-pihole-static-dhcp.conf', 'r');
|
||||
try
|
||||
{
|
||||
$dhcpstatic = @fopen('/etc/dnsmasq.d/04-pihole-static-dhcp.conf', 'r');
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo "Warning: Failed to read /etc/dnsmasq.d/04-pihole-static-dhcp.conf, this is not an error";
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!is_resource($dhcpstatic))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user