File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Controller/Adminhtml/Order/Create
Test/Unit/Controller/Adminhtml/Order/Create Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,9 @@ public function execute()
6262 if (is_array ($ updateResult ) && isset ($ updateResult ['compressed ' ]) && $ updateResult ['compressed ' ]) {
6363 if (isset ($ updateResult ['data ' ]) && function_exists ('gzdecode ' )) {
6464 // phpcs:ignore Magento2.Functions.DiscouragedFunction
65- $ resultRaw ->setContents (@gzdecode ($ updateResult ['data ' ]) ?: '' );
65+ $ decompressed = gzdecode ($ updateResult ['data ' ]);
66+ // gzdecode returns false on error, handle gracefully
67+ $ resultRaw ->setContents (is_string ($ decompressed ) ? $ decompressed : '' );
6668 } else {
6769 $ resultRaw ->setContents ('' );
6870 }
Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ class ShowUpdateResultTest extends TestCase
7272
7373 /**
7474 * @inheritdoc
75+ *
76+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
7577 */
7678 protected function setUp (): void
7779 {
You can’t perform that action at this time.
0 commit comments