From dc32d4eda15d239c6f7c193321ead84a76ba3ca2 Mon Sep 17 00:00:00 2001 From: Pierre Lebedel Date: Tue, 22 Oct 2024 14:14:08 +0200 Subject: [PATCH 1/2] Passes class options to single instances Options passed on construct were not passed on single instances. Now when we work in multiple mode, each child inherits the class options (Collapse). --- vCard.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vCard.php b/vCard.php index b2f0476..035f096 100644 --- a/vCard.php +++ b/vCard.php @@ -137,7 +137,7 @@ public function __construct($Path = false, $RawData = false, array $Options = nu $SinglevCardRawData = 'BEGIN:VCARD'."\n".$SinglevCardRawData; $ClassName = get_class($this); - $this -> Data[] = new $ClassName(false, $SinglevCardRawData); + $this -> Data[] = new $ClassName(false, $SinglevCardRawData, $this -> Options); } } else @@ -686,4 +686,4 @@ public function key() return key($this -> Data); } } -?> \ No newline at end of file +?> From 9248e8bfdf651de491e795f800ab8567a61a74bb Mon Sep 17 00:00:00 2001 From: Pierre Lebedel Date: Tue, 22 Oct 2024 14:24:33 +0200 Subject: [PATCH 2/2] Pass class options to the children --- vCard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vCard.php b/vCard.php index 035f096..91b4513 100644 --- a/vCard.php +++ b/vCard.php @@ -183,7 +183,7 @@ public function __construct($Path = false, $RawData = false, array $Options = nu if ((strpos($Key, 'agent') === 0) && (stripos($Value, 'begin:vcard') !== false)) { $ClassName = get_class($this); - $Value = new $ClassName(false, str_replace('-wrap-', "\n", $Value)); + $Value = new $ClassName(false, str_replace('-wrap-', "\n", $Value, $this -> Options)); if (!isset($this -> Data[$Key])) { $this -> Data[$Key] = array();