Created
September 9, 2025 13:26
-
-
Save SamJUK/094d8a9ad69a3d265e1d336285a1e1e7 to your computer and use it in GitHub Desktop.
Revisions
-
SamJUK created this gist
Sep 9, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ diff --git a/vendor/magento/framework/Webapi/ServiceInputProcessor.php b/vendor/magento/framework/Webapi/ServiceInputProcessor.php index ba58dc2bc7acf..06919af36d2eb 100644 --- a/vendor/magento/framework/Webapi/ServiceInputProcessor.php +++ b/vendor/magento/framework/Webapi/ServiceInputProcessor.php @@ -246,6 +246,13 @@ private function getConstructorData(string $className, array $data): array if (isset($data[$parameter->getName()])) { $parameterType = $this->typeProcessor->getParamType($parameter); + // Allow only simple types or Api Data Objects + if (!($this->typeProcessor->isTypeSimple($parameterType) + || preg_match('~\\\\?\w+\\\\\w+\\\\Api\\\\Data\\\\~', $parameterType) === 1 + )) { + continue; + } + try { $res[$parameter->getName()] = $this->convertValue($data[$parameter->getName()], $parameterType); } catch (\ReflectionException $e) {