diff options
| -rw-r--r-- | views/mods/mod_voucherproduct/voucher_pdf.phtml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/views/mods/mod_voucherproduct/voucher_pdf.phtml b/views/mods/mod_voucherproduct/voucher_pdf.phtml index 35e54f4..c66a960 100644 --- a/views/mods/mod_voucherproduct/voucher_pdf.phtml +++ b/views/mods/mod_voucherproduct/voucher_pdf.phtml @@ -30,7 +30,7 @@ $t['text'] = $this->replaceUniversalPlatzhalter($t['text'], $this->view['order_id'], false, false, $this->view['product_id'], $this->view['customReplace'], $this->view['product_index']);
- if ($t['alpha'] > 0) $pdf->setAlpha($t['alpha']);
+ $pdf->setAlpha((($t['alpha'] ?? '') === '') ? 1 : min(1, max(0, floatval(str_replace(',', '.', $t['alpha'])))));
$pdf->wpsg_SetTextColor($t['color']);
@@ -70,7 +70,7 @@ $t['text'] = $this->replaceUniversalPlatzhalter($t['text'], $this->view['order_id'], false, false, $this->view['product_id'], $this->view['customReplace'], $this->view['product_index']);
- if ($t['alpha'] > 0) $pdf->setAlpha($t['alpha']);
+ $pdf->setAlpha((($t['alpha'] ?? '') === '') ? 1 : min(1, max(0, floatval(str_replace(',', '.', $t['alpha'])))));
$pdf->SetFont('Arial', '', $t['fontsize']);
$pdf->wpsg_SetTextColor($t["color"]);
|
