From 57f330c099b509da88a0785ca503bb9853e16b51 Mon Sep 17 00:00:00 2001 From: Jeroen Moors Date: Mon, 27 Jan 2014 10:21:43 +0100 Subject: [PATCH] Handle the cases were there's no whitespace after _documentXML, "_documentXML) - $offset) * -1)); + $rowStart = strrpos($this->_documentXML, "_documentXML) - $offset) * -1)); + if (!$rowStart) { + $rowStart = strrpos($this->_documentXML, "", ((strlen($this->_documentXML) - $offset) * -1)); + } + if (!$rowStart) { + trigger_error("Can not find the start position of the row to clone."); + return false; + } + return $rowStart; } /** @@ -137,7 +145,8 @@ class PHPWord_Template * @param mixed $offset */ private function _findRowEnd($offset) { - return strpos($this->_documentXML, "", $offset) + 7; + $rowEnd = strpos($this->_documentXML, "", $offset) + 7; + return $rowEnd; } /**