From c8200e23e619cc2d3f47f035fcdc7ad552ea7c0c Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sat, 12 Feb 2022 12:24:09 +0000 Subject: [PATCH] Prevent misleading warning being printed to the lighttpd error log when attempting to flush tables that don't actually exist Signed-off-by: Adam Warner --- scripts/pi-hole/php/teleporter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/pi-hole/php/teleporter.php b/scripts/pi-hole/php/teleporter.php index 0e9740f204..f378ded476 100644 --- a/scripts/pi-hole/php/teleporter.php +++ b/scripts/pi-hole/php/teleporter.php @@ -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);