From 00f10a24a2da46b08d2e251d62e8a1302bfa2ed7 Mon Sep 17 00:00:00 2001 From: Dominik Kohler Date: Mon, 20 Feb 2023 18:34:41 +0100 Subject: [PATCH] Test ini-parameter for truthy instead of string --- src/PaymentPart/Output/FpdfOutput/FpdfOutput.php | 2 +- tests/PaymentPart/Output/FpdfOutput/FpdfOutputTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PaymentPart/Output/FpdfOutput/FpdfOutput.php b/src/PaymentPart/Output/FpdfOutput/FpdfOutput.php index ab3ee5fc..61d1b77b 100644 --- a/src/PaymentPart/Output/FpdfOutput/FpdfOutput.php +++ b/src/PaymentPart/Output/FpdfOutput/FpdfOutput.php @@ -100,7 +100,7 @@ private function addSwissQrCodeImage(): void $yPosQrCode = 209.5 + $this->offsetY; $xPosQrCode = 67 + $this->offsetX; - if ("1" === ini_get('allow_url_fopen')) { + if ((bool)ini_get('allow_url_fopen')) { $this->fpdf->Image( $qrCode->getDataUri($this->getQrCodeImageFormat()), $xPosQrCode, diff --git a/tests/PaymentPart/Output/FpdfOutput/FpdfOutputTest.php b/tests/PaymentPart/Output/FpdfOutput/FpdfOutputTest.php index 75444ec5..eeaa8a7d 100644 --- a/tests/PaymentPart/Output/FpdfOutput/FpdfOutputTest.php +++ b/tests/PaymentPart/Output/FpdfOutput/FpdfOutputTest.php @@ -80,7 +80,7 @@ public function testItThrowsSvgNotSupportedException(): void public function testItThrowsUnsupportedEnvironmentException(): void { - if (ini_get('allow_url_fopen') === "1") { + if ((bool)ini_get('allow_url_fopen')) { $this->markTestSkipped("This test only works in hardened environment."); }