Skip to content

Commit c7d58d0

Browse files
committed
AC-10815 - API Input validation
1 parent 2a0af7a commit c7d58d0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/internal/Magento/Framework/Webapi/ServiceInputProcessor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,11 @@ public function process($serviceClassName, $serviceMethodName, array $inputArray
228228
private function getConstructorData(string $className, array $data): array
229229
{
230230
$preferenceClass = $this->config->getPreference($className);
231-
$class = new ClassReflection($preferenceClass ?: $className);
232-
if ($class->isSubclassOf(\SimpleXMLElement::class) || $class->isSubclassOf( \DOMNode::class)) {
231+
if (is_subclass_of($preferenceClass, \SimpleXMLElement::class)
232+
|| is_subclass_of($preferenceClass, \DOMElement::class)) {
233233
return [];
234234
}
235+
$class = new ClassReflection($preferenceClass ?: $className);
235236

236237
try {
237238
$constructor = $class->getMethod('__construct');

0 commit comments

Comments
 (0)