Skip to content

Commit

Permalink
Prevent misleading warning being printed to the lighttpd error log wh…
Browse files Browse the repository at this point in the history
…en attempting to flush tables that don't actually exist

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
  • Loading branch information
PromoFaux committed Feb 12, 2022
1 parent d9ad678 commit c8200e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/pi-hole/php/teleporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ function archive_restore_table($file, $table, $flush=false)
if(is_null($contents))
return 0;

$flush_ignore = array("blacklist", "regex_blacklist", "whitelist", "regex_whitelist");

// Flush table if requested, only flush each table once
if($flush && !in_array($table, $flushed_tables))
if($flush && !in_array($table, $flushed_tables) && !in_array($table, $flush_ignore))
{
$db->exec("DELETE FROM \"".$table."\"");
array_push($flushed_tables, $table);
Expand Down

0 comments on commit c8200e2

Please sign in to comment.