Commit 903b9638 authored by jcnventura's avatar jcnventura

Fix #420460: When using TCPDF remove imagefield/filefield numerical query from image filenames

parent caaeb140
......@@ -194,8 +194,12 @@ function _print_pdf_tcpdf($print, $html, $filename) {
define('K_CELL_HEIGHT_RATIO', 1.25);
define('K_SMALL_RATIO', 2/3);
// Decode HTML entities in image filenames
$pattern = "!<img[^>]*?>!is";
$html = preg_replace_callback($pattern, create_function('$matches', 'return html_entity_decode($matches[0], ENT_QUOTES);'), $html);
// Remove imagefield/filefield numerical parameter
$pattern = "!(<img\s[^>]*?src\s*?=.*?)%3F\d+([^>]*?>)!is";
$html = preg_replace($pattern, '$1$2', $html);
require_once(DRUPAL_ROOT . '/' . $print_pdf_pdf_tool);
if (strpos(PDF_PRODUCER, 'PHP4') === FALSE) {
......
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