From 301e481fbe1acb04b5253adf1a8ecee948e3bc60 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Thu, 15 Sep 2022 19:07:28 +0200 Subject: [PATCH] loadConfig returns config that was actually applied --- src/PhpWord/Settings.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PhpWord/Settings.php b/src/PhpWord/Settings.php index 80e512d2..79663317 100644 --- a/src/PhpWord/Settings.php +++ b/src/PhpWord/Settings.php @@ -424,19 +424,21 @@ class Settings if ($configFile !== null) { $config = @parse_ini_file($configFile); if ($config === false) { - return $config; + return array(); } } // Set config value + $appliedConfig = array(); foreach ($config as $key => $value) { $method = "set{$key}"; if (method_exists(__CLASS__, $method)) { self::$method($value); + $appliedConfig[$key] = $value; } } - return $config; + return $appliedConfig; } /**