Optimized regular expression (#268)

Fix: Empty result for big reports with writeHTML()
This commit is contained in:
Alexander Rakushin 2021-03-27 11:45:34 +03:00 committed by GitHub
parent da030d11b7
commit f0e42daeae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16372,7 +16372,7 @@ class TCPDF {
// create a special tag to contain the CSS array (used for table content)
$csstagarray = '<cssarray>'.htmlentities(json_encode($css)).'</cssarray>';
// remove head and style blocks
$html = preg_replace('/<head([^\>]*)>(.*?)<\/head>/siU', '', $html);
$html = preg_replace('/<head([^\>]*)>(.*)?<\/head>/siU', '', $html);
$html = preg_replace('/<style([^\>]*)>([^\<]*)<\/style>/isU', '', $html);
// define block tags
$blocktags = array('blockquote','br','dd','dl','div','dt','h1','h2','h3','h4','h5','h6','hr','li','ol','p','pre','ul','tcpdf','table','tr','td');