diff --git a/app/code/Magento/Catalog/Model/ImageExtractor.php b/app/code/Magento/Catalog/Model/ImageExtractor.php index 977e76509afd2..2b521cc732a2a 100644 --- a/app/code/Magento/Catalog/Model/ImageExtractor.php +++ b/app/code/Magento/Catalog/Model/ImageExtractor.php @@ -5,10 +5,11 @@ */ namespace Magento\Catalog\Model; -use Magento\Catalog\Model\Product\Attribute\Backend\Media\ImageEntryConverter; use Magento\Catalog\Helper\Image; +use Magento\Catalog\Model\Product\Attribute\Backend\Media\ImageEntryConverter; +use Magento\Framework\View\Xsd\Media\TypeDataExtractorInterface; -class ImageExtractor implements \Magento\Framework\View\Xsd\Media\TypeDataExtractorInterface +class ImageExtractor implements TypeDataExtractorInterface { /** * Extract configuration data of images from the DOM structure @@ -30,8 +31,11 @@ public function process(\DOMElement $mediaNode, $mediaParentTag) if ($attribute->nodeType != XML_ELEMENT_NODE) { continue; } - if ($attribute->tagName == 'background') { + $attributeTagName = $attribute->tagName; + if ($attributeTagName === 'background') { $nodeValue = $this->processImageBackground($attribute->nodeValue); + } elseif ($attributeTagName === 'width' || $attributeTagName === 'height') { + $nodeValue = intval($attribute->nodeValue); } else { $nodeValue = $attribute->nodeValue; } @@ -55,6 +59,7 @@ private function processImageBackground($backgroundString) $backgroundArray = []; if (preg_match($pattern, $backgroundString, $backgroundArray)) { array_shift($backgroundArray); + $backgroundArray = array_map('intval', $backgroundArray); } return $backgroundArray; } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ImageExtractorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ImageExtractorTest.php index 23b17ed8b5304..c952af85ea6e1 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ImageExtractorTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ImageExtractorTest.php @@ -23,7 +23,7 @@ protected function setUp() public function testProcess() { $expectedArray = include(__DIR__ . '/_files/converted_view.php'); - $this->assertEquals($expectedArray, $this->model->process($this->getDomElement(), 'media')); + $this->assertSame($expectedArray, $this->model->process($this->getDomElement(), 'media')); } /** diff --git a/app/code/Magento/Customer/etc/webapi.xml b/app/code/Magento/Customer/etc/webapi.xml index f78d9c01d16a3..faec9c612e6c6 100644 --- a/app/code/Magento/Customer/etc/webapi.xml +++ b/app/code/Magento/Customer/etc/webapi.xml @@ -188,6 +188,12 @@ + + + + + + diff --git a/app/code/Magento/Directory/etc/zip_codes.xml b/app/code/Magento/Directory/etc/zip_codes.xml index 1976c2cb46b25..385ee58eb1f67 100644 --- a/app/code/Magento/Directory/etc/zip_codes.xml +++ b/app/code/Magento/Directory/etc/zip_codes.xml @@ -318,7 +318,7 @@ - ^[0-9]{4}\s[a-zA-Z]{2}$ + ^[1-9][0-9]{3}\s?[a-zA-Z]{2}$