From ac0b0f714d26427fb749be3ba0ebdf8a546a6328 Mon Sep 17 00:00:00 2001 From: David Stone Date: Fri, 20 Dec 2024 10:45:34 -0700 Subject: [PATCH] Fix infinite loop while installing --- inc/class-settings.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/inc/class-settings.php b/inc/class-settings.php index 185d072..bc39288 100644 --- a/inc/class-settings.php +++ b/inc/class-settings.php @@ -48,6 +48,11 @@ class Settings { */ private $sections = null; + /** + * @var bool + */ + private bool $saving = false; + /** * Runs on singleton instantiation. * @@ -160,8 +165,12 @@ class Settings { } // end if; if ($this->settings === false || empty($this->settings)) { - - $this->settings = $this->save_settings(array(), true); + if (! $this->saving) { + $this->saving = true; + $this->settings = $this->save_settings( array(), true ); + } else { + return array(); + } } // end if;