Skip to content

Commit fde5551

Browse files
authored
Merge pull request #7614 from magento-amigos/2.4-develop-prs
[Amigos] Community Contributions - 2.4-develop
2 parents f1adf23 + 718fb5f commit fde5551

File tree

14 files changed

+169
-54
lines changed

14 files changed

+169
-54
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Bug report
2+
description: Technical issue with the Magento 2 core components
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
Please read [our guidelines](https://developer.adobe.com/commerce/contributor/guides/code-contributions/#report-an-issue) before submitting the issue.
8+
- type: textarea
9+
attributes:
10+
label: Preconditions and environment
11+
description: |
12+
Describe your environment.
13+
Provide all the details that will help us to reproduce the bug.
14+
value: |
15+
- Magento version
16+
- Anything else that would help a developer reproduce the bug
17+
- type: textarea
18+
attributes:
19+
label: Steps to reproduce
20+
description: |
21+
Provide a set of clear steps to reproduce this bug.
22+
placeholder: |
23+
Example:
24+
1. Navigate to storefront as a guest.
25+
2. Open Test Category.
26+
3. Click “Add to Cart” on the Virtual Product.
27+
4. Open mini shopping cart and click “Proceed to Checkout”.
28+
validations:
29+
required: true
30+
- type: textarea
31+
attributes:
32+
label: Expected result
33+
description: |
34+
Tell us what you expected to happen.
35+
placeholder: |
36+
Example:
37+
Order is placed successfully, customer is redirected to the success page.
38+
validations:
39+
required: true
40+
- type: textarea
41+
attributes:
42+
label: Actual result
43+
description: |
44+
Tell us what happened. Include error messages and issues.
45+
placeholder: |
46+
Example:
47+
“Place order” button is not visible, order cannot be placed.
48+
validations:
49+
required: true
50+
- type: textarea
51+
attributes:
52+
label: Additional information
53+
description: |
54+
Additional information is often requested when the bug report is processed. You can save time by providing both Magento and browser logs, screenshots, repository branch and HEAD commit you checked out to install Magento and any other artifacts related to the issue.
55+
Also, links to the comments with important information, Root Cause analysis, additional video recordings; and anything else that is important for the issue and at some reason cannot be added to other sections.
56+
- type: textarea
57+
attributes:
58+
label: Release note
59+
description: |
60+
Help us to provide meaningful release notes to the community.
61+
- type: checkboxes
62+
attributes:
63+
label: Triage and priority
64+
description: |
65+
Provide [Severity](https://developer.adobe.com/commerce/contributor/guides/code-contributions/#community-backlog-priority) assessment for the Issue as a Reporter.
66+
This information helps us during the Confirmation and Issue triage processes.
67+
options:
68+
- label: 'Severity: **S0** _- Affects critical data or functionality and leaves users without workaround._'
69+
- label: 'Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._'
70+
- label: 'Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._'
71+
- label: 'Severity: **S3** _- Affects non-critical data or functionality and does not force users to employ a workaround._'
72+
- label: 'Severity: **S4** _- Affects aesthetics, professional look and feel, “quality” or “usability”._'

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Magento values the contributions of the security research community, and we look
44

55
## Where should I report security issues?
66

7-
We strongly encourage you to report all security issues privately via our [bug bounty program](https://hackerone.com/magento). Please provide us with relevant technical details and repro steps to expedite our investigation. If you prefer not to use HackerOne, email us directly at `psirt@adobe.com` with details and repro steps.
7+
We strongly encourage you to report all security issues privately via our [bug bounty program](https://hackerone.com/adobe). Please provide us with relevant technical details and repro steps to expedite our investigation. If you prefer not to use HackerOne, email us directly at `psirt@adobe.com` with details and repro steps.
88

99
## Learning More About Security
1010
To learn more about securing a Magento store, please visit the [Security Center](https://magento.com/security).

app/code/Magento/Catalog/Test/Mftf/Data/ImageContentData.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,8 @@
4343
<entity name="MagentoPlaceHolderImageContent" type="ImageContent">
4444
<data key="baseImage_md5">c0459a796c5b8ee74254472c235a7460</data>
4545
</entity>
46+
<entity name="TestImageWithDotInFilenameImageContent" extends="MagentoLogoImageContent" type="ImageContent">
47+
<data key="baseImage_md5">4aa2a3c3eefd29898585a8dd781e5bfd</data>
48+
<data key="name" unique="prefix">m.agento-logo.png</data>
49+
</entity>
4650
</entities>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,11 @@
431431
<data key="file">test_image.jpg</data>
432432
<data key="filename">test_image</data>
433433
</entity>
434+
<entity name="TestImageWithDotInFilename" extends="MagentoLogo" type="image">
435+
<data key="title" unique="suffix">TestImageWithDotInFilename</data>
436+
<data key="file">m.agento-logo.png</data>
437+
<data key="filename">m.agento-logo</data>
438+
</entity>
434439
<entity name="ProductWithUnicode" type="product">
435440
<data key="name" unique="suffix">&#38657;&#20135;&#21697;</data>
436441
<data key="sku" unique="suffix">&#38657;&#20135;&#21697;</data>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontProductImageWithDotTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Product Image"/>
15+
<title value="Product image with dot in filename should be visible on frontend after catalog image cache flush"/>
16+
<description value="Product image with dot in filename should be visible on frontend after catalog image cache flush"/>
17+
<group value="Catalog"/>
18+
<severity value="AVERAGE"/>
19+
</annotations>
20+
<before>
21+
<magentoCLI command="config:set system/upload_configuration/enable_resize 0" stepKey="disableImageResizing"/>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
</before>
24+
<after>
25+
<magentoCLI command="config:set system/upload_configuration/enable_resize 1" stepKey="enableImageResizing"/>
26+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct">
27+
<argument name="sku" value="{{SimpleProduct.sku}}"/>
28+
</actionGroup>
29+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/>
30+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsAdmin"/>
31+
</after>
32+
33+
<!--Create product-->
34+
<actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="openNewProductPage"/>
35+
<actionGroup ref="FillMainProductFormActionGroup" stepKey="fillSimpleProductMain">
36+
<argument name="product" value="SimpleProduct"/>
37+
</actionGroup>
38+
39+
<!-- Add image to product -->
40+
<actionGroup ref="AddProductImageActionGroup" stepKey="addImageForSimpleProduct">
41+
<argument name="image" value="TestImageWithDotInFilename"/>
42+
</actionGroup>
43+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/>
44+
45+
<!-- Flush catalog image cache -->
46+
<actionGroup ref="AdminGoToCacheManagementPageActionGroup" stepKey="goToCacheManagementPage"/>
47+
<actionGroup ref="AdminClickFlushCatalogImagesCacheActionGroup" stepKey="clearCatalogImageCache"/>
48+
49+
<!-- Assert product in storefront product page -->
50+
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="assertProductInStorefrontProductPage">
51+
<argument name="product" value="SimpleProduct"/>
52+
</actionGroup>
53+
54+
<!-- Assert product image in storefront product page -->
55+
<grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.imageFile(TestImageWithDotInFilename.filename)}}" stepKey="productImageURL"/>
56+
<helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertProductImageEqualToOriginalImage">
57+
<argument name="url">{$productImageURL}</argument>
58+
<argument name="expectedString">{{TestImageWithDotInFilenameImageContent.baseImage_md5}}</argument>
59+
<argument name="message">Url: "{$productImageURL}" did not render image: {{TestImageWithDotInFilename.file}}</argument>
60+
</helper>
61+
</test>
62+
</tests>

app/code/Magento/MediaStorage/App/Media.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ private function setPlaceholderImage(): void
259259
*/
260260
private function getOriginalImage(string $resizedImagePath): string
261261
{
262-
return preg_replace('|^.*?((?:/([^/])/([^/])/\2\3)?/?[^/]+$)|', '$1', $resizedImagePath);
262+
return preg_replace('|^.*((?:/[^/]+){3})$|', '$1', $resizedImagePath);
263263
}
264264

265265
/**

app/code/Magento/MediaStorage/Model/File/Validator/Image.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\Framework\File\Mime;
1111
use Magento\Framework\Filesystem\Driver\File;
12+
use Magento\Framework\Image\Factory;
1213

1314
/**
1415
* Image validator
@@ -33,20 +34,28 @@ class Image extends \Zend_Validate_Abstract
3334
*/
3435
private $fileMime;
3536

37+
/**
38+
* @var Factory
39+
*/
40+
private $imageFactory;
41+
3642
/**
3743
* @var File
3844
*/
3945
private $file;
4046

4147
/**
4248
* @param Mime $fileMime
49+
* @param Factory $imageFactory
4350
* @param File $file
4451
*/
4552
public function __construct(
4653
Mime $fileMime,
54+
Factory $imageFactory,
4755
File $file
4856
) {
4957
$this->fileMime = $fileMime;
58+
$this->imageFactory = $imageFactory;
5059
$this->file = $file;
5160
}
5261

@@ -60,10 +69,8 @@ public function isValid($filePath): bool
6069

6170
if (in_array($fileMimeType, $this->imageMimeTypes)) {
6271
try {
63-
//phpcs:ignore Magento2.Functions.DiscouragedFunction
64-
$image = imagecreatefromstring($this->file->fileGetContents($filePath));
65-
66-
$isValid = $image ? true : false;
72+
$image = $this->imageFactory->create($filePath);
73+
$image->open();
6774
} catch (\Exception $e) {
6875
$isValid = false;
6976
}

app/code/Magento/PaypalGraphQl/Model/Resolver/PaypalExpressToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function resolve(
8383
) {
8484
$cartId = $args['input']['cart_id'] ?? '';
8585
$paymentCode = $args['input']['code'] ?? '';
86-
$usePaypalCredit = isset($args['input']['paypal_credit']) ? $args['input']['paypal_credit'] : false;
86+
$usePaypalCredit = isset($args['input']['use_paypal_credit']) ? $args['input']['use_paypal_credit'] : false;
8787
$usedExpressButton = isset($args['input']['express_button']) ? $args['input']['express_button'] : false;
8888
$customerId = $context->getUserId();
8989

app/code/Magento/Ups/Model/Carrier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ protected function _formShipmentRequest(DataObject $request)
14611461
$shipperPart->addChild('PhoneNumber', $request->getRecipientContactPhoneNumber());
14621462

14631463
$addressPart = $shipperPart->addChild('Address');
1464-
$addressPart->addChild('AddressLine1', $request->getRecipientAddressStreet());
1464+
$addressPart->addChild('AddressLine1', $request->getRecipientAddressStreet1());
14651465
$addressPart->addChild('AddressLine2', $request->getRecipientAddressStreet2());
14661466
$addressPart->addChild('City', $request->getRecipientAddressCity());
14671467
$addressPart->addChild('CountryCode', $request->getRecipientAddressCountryCode());

0 commit comments

Comments
 (0)