Skip to content

Commit

Permalink
Always re-read FTL config file at start of settings page to refresh o…
Browse files Browse the repository at this point in the history
…ld config data from before running the savesettings.php code

Signed-off-by: DL6ER <dl6er@dl6er.de>
  • Loading branch information
DL6ER committed Feb 19, 2022
1 parent 1d67146 commit 8cad811
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/pi-hole/php/FTL.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

$piholeFTLConfFile = "/etc/pihole/pihole-FTL.conf";

function piholeFTLConfig()
function piholeFTLConfig($force=false)
{
static $piholeFTLConfig;
global $piholeFTLConfFile;

if(isset($piholeFTLConfig))
if(isset($piholeFTLConfig) && !$force)
{
return $piholeFTLConfig;
}
Expand Down
7 changes: 5 additions & 2 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
require_once "scripts/pi-hole/php/FTL.php";
// Reread ini file as things might have been changed
$setupVars = parse_ini_file("/etc/pihole/setupVars.conf");
$piholeFTLConf = piholeFTLConfig();
$piholeFTLConf = piholeFTLConfig(true);

// Handling of PHP internal errors
$last_error = error_get_last();
Expand Down Expand Up @@ -957,7 +957,10 @@ function convertseconds($argument)
It is important to note that rate-limiting is happening on a
per-client basis. Other clients can continue to use FTL while
rate-limited clients are short-circuited at the same time.</p>
<p>Rate-limiting may be disabled altogether by setting both values to zero.</p>
<p>Rate-limiting may be disabled altogether by setting both
values to zero. See
<a href="https://docs.pi-hole.net/ftldns/configfile/#rate_limit" target="_blank">our documentation</a>
for further details.</p>
<br>
<h4>Conditional forwarding</h4>
<p>If not configured as your DHCP server, Pi-hole typically won't be able to
Expand Down

0 comments on commit 8cad811

Please sign in to comment.