Skip to content

Commit d9ea617

Browse files
committed
Fixes #1750 added proper block cloning to put the image size part after the #number and fixing Process call to array instead of string
1 parent b8346af commit d9ea617

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/PhpWord/TemplateProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ protected function indexClonedVariables($count, $xmlBlock)
10851085
{
10861086
$results = array();
10871087
for ($i = 1; $i <= $count; $i++) {
1088-
$results[] = preg_replace('/\$\{(.*?)\}/', '\${\\1#' . $i . '}', $xmlBlock);
1088+
$results[] = preg_replace('/\$\{(.*?)(:.*)?\}/', '\${\1#' . $i . '\2}', $xmlBlock);
10891089
}
10901090

10911091
return $results;

tests/PhpWord/_includes/AbstractWebServerEmbeddedTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ abstract class AbstractWebServerEmbeddedTest extends \PHPUnit\Framework\TestCase
2626
public static function setUpBeforeClass()
2727
{
2828
if (self::isBuiltinServerSupported()) {
29-
self::$httpServer = new Process('php -S localhost:8080 -t tests/PhpWord/_files');
29+
self::$httpServer = new Process(array('php', '-S', 'localhost:8080', '-t', 'tests/PhpWord/_files'));
3030
self::$httpServer->start();
3131
while (!self::$httpServer->isRunning()) {
3232
usleep(1000);

0 commit comments

Comments
 (0)