Skip to content

#120 - Test for using custom tax receipt template

DaveD requested to merge DaveD/cdntaxreceipts:customtemplate-test into master

This will fail at the moment.

To pass it would need this hack to FPDI, but long-term it's better to figure out how to upgrade FPDI.

diff --git a/FPDI/fpdi.php b/FPDI/fpdi.php
index f799495..40e3c26 100755
--- a/FPDI/fpdi.php
+++ b/FPDI/fpdi.php
@@ -560,7 +560,8 @@ class FPDI extends FPDF_TPL

                        reset ($value[1]);

-                       while (list($k, $v) = each($value[1])) {
+                       //while (list($k, $v) = each($value[1])) {
+                       foreach ($value[1] as $k => $v) {
                                $this->_straightOut($k . ' ');
                                $this->_writeValue($v);
                        }
diff --git a/FPDI/fpdi_pdf_parser.php b/FPDI/fpdi_pdf_parser.php
index 78ea7ae..27a3685 100755
--- a/FPDI/fpdi_pdf_parser.php
+++ b/FPDI/fpdi_pdf_parser.php
@@ -312,7 +312,7 @@ class fpdi_pdf_parser extends pdf_parser
         }

         $res = $this->_getPageRotation($obj[1][1]['/Parent']);
-        if ($res[0] == pdf_parser::TYPE_OBJECT)
+        if (is_array($res) && ($res[0] == pdf_parser::TYPE_OBJECT))
             return $res[1];

         return $res;

Merge request reports

Loading