check if we can use the XSL extension, to not give a fatal error and rendering whole merge-print non-functional AND only keep tags, if XSL is available

This commit is contained in:
Ralf Becker 2011-09-12 10:56:08 +00:00
parent fcb9320b54
commit 1d6f9f0bfe

View File

@ -698,6 +698,9 @@ abstract class bo_merge
// Tags we can replace with the target document's version
$replace_tags = array();
// only keep tags, if we have xsl extension available
if (class_exists(XSLTProcessor) && class_exists(DOMDocument))
{
switch($mimetype.$mso_application_progid)
{
case 'application/vnd.oasis.opendocument.text': // open office
@ -716,6 +719,7 @@ abstract class bo_merge
);
break;
}
}
// clean replacements from array values and html or html-entities, which mess up xml
foreach($replacements as $name => &$value)
{
@ -1039,8 +1043,11 @@ abstract class bo_merge
}
// Apply HTML formatting to target document, if possible
// check if we can use the XSL extension, to not give a fatal error and rendering whole merge-print non-functional
if (class_exists(XSLTProcessor) && class_exists(DOMDocument))
{
$this->apply_styles($merged, $mimetype);
}
if(!empty($name))
{
if(empty($ext))