From 2bba013311bdb3e728d3facc807b77e02561d894 Mon Sep 17 00:00:00 2001 From: Michael Als Date: Tue, 29 Mar 2022 13:13:45 +0000 Subject: [PATCH] PHP 8.1 compatability fix for PreserveText --- src/PhpWord/Element/PreserveText.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/Element/PreserveText.php b/src/PhpWord/Element/PreserveText.php index c0e64268..803ee4f3 100644 --- a/src/PhpWord/Element/PreserveText.php +++ b/src/PhpWord/Element/PreserveText.php @@ -60,7 +60,7 @@ class PreserveText extends AbstractElement $this->paragraphStyle = $this->setNewStyle(new Paragraph(), $paragraphStyle); $this->text = SharedText::toUTF8($text); - $matches = preg_split('/({.*?})/', $this->text, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); + $matches = preg_split('/({.*?})/', $this->text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); if (isset($matches[0])) { $this->text = $matches; }