Commit b9a69e89 authored by jcnventura's avatar jcnventura

Fix #301192: handle arrays in queries correctly

parent b698536b
......@@ -477,13 +477,24 @@ function print_link_allowed($args) {
* @return
* urlencoded string which can be appended to/as the URL query string
*/
function print_query_string_encode($query, $exclude = array()) {
function print_query_string_encode($query, $exclude = array(), $parent = '') {
$params = array();
foreach ($query as $key => $value) {
if ($parent) {
$key = $parent .'['. $key .']';
}
if (in_array($key, $exclude)) {
continue;
}
$params[] = $key .'='. rawurlencode($value);
if (is_array($value)) {
$params[] = drupal_query_string_encode($value, $exclude, $key);
}
else {
$params[] = $key .'='. rawurlencode($value);
}
}
return implode('&', $params);
}
......@@ -81,6 +81,14 @@ function _print_pdf_dompdf($print, $html, $filename) {
$dompdf->set_paper(drupal_strtolower($print_pdf_paper_size), $print_pdf_page_orientation);
$dompdf->set_protocol($protocol);
$text = '<script type="text/php">
if ( isset($pdf) ) {
$font = Font_Metrics::get_font("verdana", "bold");
$pdf->page_text(72, 18, "Fancy Header", $font, 20, array(0,0,0));
}
</script>';
$html = str_replace("<body>", "<body>" . $text, $html);
$dompdf->load_html($html);
$dompdf->render();
......
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