From 6c2a6eec32e498375eba4cfecf707b79162fd250 Mon Sep 17 00:00:00 2001 From: Chris Pook Date: Thu, 11 Mar 2021 11:50:58 +0000 Subject: [PATCH] Use tested $fileName in exception message for consistency This is a fix for #32446. The adapter does not necessarily have $this->_fileName set in the scenario where $filename doesn't exist. For consistency it is best to use the $filename param value here as that is the one that was tested to exist and has the correct value. --- lib/internal/Magento/Framework/Image/Adapter/Gd2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Image/Adapter/Gd2.php b/lib/internal/Magento/Framework/Image/Adapter/Gd2.php index bebf64c56596a..05b7f1b193b4f 100644 --- a/lib/internal/Magento/Framework/Image/Adapter/Gd2.php +++ b/lib/internal/Magento/Framework/Image/Adapter/Gd2.php @@ -65,7 +65,7 @@ public function open($filename) { if (!file_exists($filename)) { throw new FileSystemException( - new Phrase('File "%1" does not exist.', [$this->_fileName]) + new Phrase('File "%1" does not exist.', [$filename]) ); } if (!$filename || filesize($filename) === 0 || !$this->validateURLScheme($filename)) {