Commit 7af42679 authored by jcnventura's avatar jcnventura

Filter all scripts in HTML provided to PDF generation libraries.

parent 44ce376d
......@@ -137,6 +137,8 @@ function print_pdf_generate_path($path, $query = NULL, $cid = NULL, $pdf_filenam
$html = preg_replace_callback($pattern, '_print_rewrite_urls', $html);
// And make anchor links relative again, to permit in-PDF navigation.
$html = preg_replace("!${base_url}/" . $link['path'] . '/.*?#!', '#', $html);
// Remove all scripts due to security concerns.
$html = preg_replace('!<script(.*?)>(.*?)</script>!is', '', $html);
$meta = array(
'node' => $node,
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