Commit 6c83bb4f authored by metzlerd's avatar metzlerd
Browse files

#2063097 Email doc format has trouble with SVG.

parent a524cbd5
......@@ -10,9 +10,12 @@ class FrxEmailMergeDoc extends FrxDocument {
$body = $r->html;
$doc = new DOMDocument('1.0', 'UTF-8');
$doc->strictErrorChecking = FALSE;
libxml_use_internal_errors(true);
$doc->loadHTML($body);
libxml_clear_errors();
$xml = simplexml_import_dom($doc);
$docs = $xml->xpath('.//*[@class="email-document"]');
if (!$docs)
$prompt_subject = TRUE;
$prompt_body = TRUE;
foreach ($docs as $doc) {
......@@ -23,6 +26,7 @@ class FrxEmailMergeDoc extends FrxDocument {
$subject = $subject ? (string)$subject[0] : '';
$to = $doc->xpath('.//*[@class="email-header-to"]');
$to = $to ? (string)$to[0] : '';
if ($to) $prompt_to = FALSE;
$body = $doc->xpath('.//*[@class="email-body"]');
if ($body) $prompt_body = FALSE;
$body = $body ? $body[0]->asXML() : $body;
......@@ -40,6 +44,7 @@ class FrxEmailMergeDoc extends FrxDocument {
$output = drupal_render($form);
}
else {
drupal_set_message(t('No mail merge information in report. Displaying report instead.'), 'error');
$output = $body;
}
return $output;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment