detect actual filename of document xml (prevent mismatching document22.xml as in #1253)
This commit is contained in:
parent
18760620b3
commit
7f55816eba
|
|
@ -507,7 +507,13 @@ class TemplateProcessor
|
||||||
*/
|
*/
|
||||||
protected function getMainPartName()
|
protected function getMainPartName()
|
||||||
{
|
{
|
||||||
return 'word/document.xml';
|
$contentTypes = $this->zipClass->getFromName('[Content_Types].xml');
|
||||||
|
|
||||||
|
$pattern = '~PartName="\/(word\/document.*?\.xml)" ContentType="application\/vnd\.openxmlformats-officedocument\.wordprocessingml\.document\.main\+xml"~';
|
||||||
|
|
||||||
|
preg_match($pattern, $contentTypes, $m);
|
||||||
|
|
||||||
|
return (array_key_exists(1, $m) ? $m[1] : 'word/document.xml');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue