December 2, 2007

PDF Order Centre v1.1 bug

Filed under: ZenMagick — DerManoMann @ 3:52 am

For those interested, I fixed a bug in the PDF Order Centre today that will result in some HTML being displayed, if a coupon discount was redeemed.

The line in questions is line 430 in /admin/includes/modules/pdfoc/templates/Invoice.php

$pdf->ezText("<b>" . pdfoc_html_cleanup($order->totals[$i]['title']) . "</b>",PDFOC_TABLE_HEADER_FONT_SIZE,array('justification'=> 'right','aright'=>$x));

The coupon order total module has a link to the coupon help in the title which is printed verbatim. I changed this use a simple regular expression to remove any HTML links:

$title = preg_replace('/(.*)<a.*</a>/', '1', $order->totals[$i]['title']);
$pdf->ezText("<b>" . pdfoc_html_cleanup($title) . "</b>",PDFOC_TABLE_HEADER_FONT_SIZE,array('justification'=> 'right','aright'=>$x));

Just in case someone else out there is wondering too…

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.