summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoao Ventura2009-04-22 21:28:25 (GMT)
committer Joao Ventura2009-04-22 21:28:25 (GMT)
commit2acc49d20af9c5f7c21a81236363be07e9d60742 (patch)
treeb973783c085d3b43f10c2e0281276b8e9b312774
parente65b74634543faced48006eb1d8270d0a79cd503 (diff)
Fix #429054: decode html entities in image URLs passed to TCPDF
Fix a notice with undefined node->type when printing system pages
-rw-r--r--print.pages.inc2
-rw-r--r--print_pdf/print_pdf.pages.inc3
2 files changed, 4 insertions, 1 deletions
diff --git a/print.pages.inc b/print.pages.inc
index bd2fc60..920a182 100644
--- a/print.pages.inc
+++ b/print.pages.inc
@@ -517,7 +517,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));
}
/**
diff --git a/print_pdf/print_pdf.pages.inc b/print_pdf/print_pdf.pages.inc
index 9547fec..a8d9bff 100644
--- a/print_pdf/print_pdf.pages.inc
+++ b/print_pdf/print_pdf.pages.inc
@@ -182,6 +182,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($print_pdf_pdf_tool);
if (strpos(PDF_PRODUCER, 'PHP4') === FALSE) {
require_once(drupal_get_path('module', 'print_pdf') .'/print_pdf.class.inc');