Commit cdb13c56 authored by jcnventura's avatar jcnventura

Fix #429054: decode html entities in image URLs passed to TCPDF

Fix a notice with undefined node->type when printing system pages
parent c61e62bb
......@@ -525,7 +525,7 @@ function _print_url_list_enabled($node, $format = PRINT_HTML_FORMAT) {
// Get value of Printer-friendly URLs setting
return (variable_get('print_urls', PRINT_URLS_DEFAULT) && ($node_urllist) &&
variable_get('print_' . $fmt . 'display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT));
(isset($node->type) ? variable_get('print_' . $fmt . 'display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT) : PRINT_TYPE_URLLIST_DEFAULT));
}
/**
......
......@@ -194,6 +194,9 @@ function _print_pdf_tcpdf($print, $html, $filename) {
define('K_CELL_HEIGHT_RATIO', 1.25);
define('K_SMALL_RATIO', 2/3);
$pattern = "!<img[^>]*?>!is";
$html = preg_replace_callback($pattern, create_function('$matches', 'return html_entity_decode($matches[0], ENT_QUOTES);'), $html);
require_once(DRUPAL_ROOT . '/' . $print_pdf_pdf_tool);
if (strpos(PDF_PRODUCER, 'PHP4') === FALSE) {
require_once(DRUPAL_ROOT . '/' . drupal_get_path('module', 'print_pdf') . '/print_pdf.class.inc');
......
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