From 9a04ff5341c63ca24c4341cd6a5cb6c1ea26a1ec Mon Sep 17 00:00:00 2001 From: Joe Clark Date: Tue, 22 Mar 2022 13:06:39 -0700 Subject: [PATCH] Check if path exists before attempting to remove --- functions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/functions.php b/functions.php index f2269a64..b14b4f0b 100644 --- a/functions.php +++ b/functions.php @@ -39,6 +39,10 @@ function initials($str) { } function removeDirectory($path) { + if (!file_exists($path)) { + return; + } + $files = glob($path . '/*'); foreach ($files as $file) { is_dir($file) ? removeDirectory($file) : unlink($file); @@ -396,4 +400,4 @@ function encryptUpgradeLoginEntry($login_password_cleartext, $site_encryption_ma return $login_password_ciphertext; } -?> \ No newline at end of file +?>