Skip to content

Commit fc18246

Browse files
PreserveText preg_split fix
third parameter must be -1 not null (php 8.1 deprecate warning)
1 parent be0190c commit fc18246

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PhpWord/Element/PreserveText.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct($text = null, $fontStyle = null, $paragraphStyle = n
6060
$this->paragraphStyle = $this->setNewStyle(new Paragraph(), $paragraphStyle);
6161

6262
$this->text = SharedText::toUTF8($text);
63-
$matches = preg_split('/({.*?})/', $this->text, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
63+
$matches = preg_split('/({.*?})/', $this->text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
6464
if (isset($matches[0])) {
6565
$this->text = $matches;
6666
}

0 commit comments

Comments
 (0)