Commit f4236c76 authored by jcnventura's avatar jcnventura

Fix #371455: Convert all links in the PDF to absolute

by Zoltan Balogh: Updated Hungarian translation
parent d54079c6
...@@ -58,6 +58,10 @@ function print_pdf_controller() { ...@@ -58,6 +58,10 @@ function print_pdf_controller() {
$html = ob_get_contents(); $html = ob_get_contents();
ob_end_clean(); ob_end_clean();
// Convert the a href elements
$pattern = '!<(a\s[^>]*?)>!is';
$html = preg_replace_callback($pattern, '_print_rewrite_urls', $html);
$pdf_filename = variable_get('print_pdf_filename', PRINT_PDF_FILENAME_DEFAULT); $pdf_filename = variable_get('print_pdf_filename', PRINT_PDF_FILENAME_DEFAULT);
if (function_exists('token_replace') && !empty($pdf_filename)) { if (function_exists('token_replace') && !empty($pdf_filename)) {
$pdf_filename = token_replace($pdf_filename, 'node', $node) .'.pdf'; $pdf_filename = token_replace($pdf_filename, 'node', $node) .'.pdf';
......
This diff is collapsed.
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