Skip to content

Commit 91995dc

Browse files
committed
AC-10815 - API Input validation
1 parent dbea8e0 commit 91995dc

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

app/design/adminhtml/Magento/backend/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,3 +547,4 @@ Dashboard,Dashboard
547547
"Web Section","Web Section"
548548
"Store Email Addresses Section","Store Email Addresses Section"
549549
"Email to a Friend","Email to a Friend"
550+
"Invalid data type","Invalid data type"

app/design/frontend/Magento/blank/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,3 +439,4 @@ Summary,Summary
439439
Test,Test
440440
test,test
441441
Two,Two
442+
"Invalid data type","Invalid data type"

app/design/frontend/Magento/luma/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,3 +489,4 @@ Remove,Remove
489489
Test,Test
490490
test,test
491491
Two,Two
492+
"Invalid data type","Invalid data type"

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ protected function _createFromArray($className, $data)
280280
$className = (string) $className;
281281
if (is_subclass_of($className, \SimpleXMLElement::class)
282282
|| is_subclass_of($className, \DOMElement::class)) {
283-
return null;
283+
throw new SerializationException(
284+
new Phrase('Invalid data type.')
285+
);
284286
}
285287
$class = new ClassReflection($className);
286288
if (is_subclass_of($className, self::EXTENSION_ATTRIBUTES_TYPE)) {

0 commit comments

Comments
 (0)