From 79f65f04e17d9af45a3e8841cec37b91283e4dfd Mon Sep 17 00:00:00 2001 From: Gabriel Bull Date: Sun, 9 Mar 2014 15:11:51 -0400 Subject: [PATCH] Fixed bug with footer preserve text --- Classes/PHPWord/Section/Footer/PreserveText.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Classes/PHPWord/Section/Footer/PreserveText.php b/Classes/PHPWord/Section/Footer/PreserveText.php index 9ec896c4..b1629770 100755 --- a/Classes/PHPWord/Section/Footer/PreserveText.php +++ b/Classes/PHPWord/Section/Footer/PreserveText.php @@ -89,8 +89,10 @@ class PHPWord_Section_Footer_PreserveText $this->_styleParagraph = $styleParagraph; } - $pattern = '/({.*?})/'; - $this->_text = preg_split($pattern, $text, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); + $matches = preg_split('/({.*?})/', $text, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); + if (isset($matches[0])) { + $this->_text = $matches[0]; + } return $this; }