PMCORE-535 When using ampersands in output document the __ERROR__ variable is being set
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\Core\System;
|
||||
|
||||
class OutputDocument extends BaseOutputDocument
|
||||
@@ -961,10 +962,16 @@ class OutputDocument extends BaseOutputDocument
|
||||
}
|
||||
|
||||
// Fix the HTML using DOMDocument class
|
||||
libxml_use_internal_errors(true);
|
||||
$doc = new DOMDocument('1.0', 'UTF-8');
|
||||
if ($content != '') {
|
||||
$doc->loadHtml($content);
|
||||
foreach (libxml_get_errors() as $error) {
|
||||
$detail = (array) $error;
|
||||
Log::channel(':OutputDocument::generateTcpdf')->warning('DOMDocument::loadHtml', Bootstrap::context($detail));
|
||||
}
|
||||
}
|
||||
libxml_clear_errors();
|
||||
|
||||
// Add a page and put the HTML fixed
|
||||
$pdf->AddPage();
|
||||
|
||||
Reference in New Issue
Block a user