* Mergeprint: fixed not working merge (white screen, nothing in error-log) under PHP 5.2.6

Catchable fatal error: argument 1 to transformToXml() must be of type DOMDocument
This commit is contained in:
Ralf Becker 2011-11-17 08:44:40 +00:00
parent f1463ca189
commit 35ac4e0993

View File

@ -361,7 +361,7 @@ abstract class bo_merge
/**
* getExportLimit
* checks if there is an exportlimit set, and returns
* checks if there is an exportlimit set, and returns
* @param mixed $app_limit checks and validates app_limit, if not set returns the global limit
*
* @return mixed - no if no export is allowed, false if there is no restriction and int as there is a valid restriction
@ -377,7 +377,7 @@ abstract class bo_merge
{
//error_log(__METHOD__.__LINE__.' -> '.$app_limit.' '.function_backtrace());
$exportLimitStore[$app] = $GLOBALS['egw_info']['server']['export_limit'];
if ($app !='common')
if ($app !='common')
{
$app_limit = $GLOBALS['egw']->hooks->single('export_limit',$app);
if ($app_limit) $exportLimitStore[$app] = $app_limit;
@ -388,7 +388,7 @@ abstract class bo_merge
$exportLimitStore[$app] = false;
return false;
}
if (is_numeric($exportLimitStore[$app]))
{
$exportLimitStore[$app] = (int)$exportLimitStore[$app];
@ -523,8 +523,11 @@ abstract class bo_merge
{
try
{
$element = new SimpleXMLelement($content);
$content = @$xslt->transformToXml($element);
// does NOT work with php 5.2.6: Catchable fatal error: argument 1 to transformToXml() must be of type DOMDocument
//$element = new SimpleXMLelement($content);
$element = new DOMDocument('1.0', 'utf-8');
$element->loadXML($content);
$content = $xslt->transformToXml($element);
// Word 2003 needs two declarations, add extra declaration back in
if($mimetype == 'application/xml' && $mso_application_progid == 'Word.Document' && strpos($content, '<?xml') !== 0) {
@ -539,7 +542,7 @@ abstract class bo_merge
}
catch (Exception $e)
{
error_log($e);
error_log($e->getMessage());
// Failed...
}
}