Skip to content

Commit 98703f6

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.3-develop expedited
Accepted Community Pull Requests: - #23067: Create Security.md file to show on GitHub Security/Policy page (by @piotrekkaminski) - #23046: Add more descriptive exception when data patch fails to apply. (by @ashsmith) - #22821: Customer Account Forgot Password page title fix (by @textarea) - #22884: Show exception message during SCD failure (by @ihor-sviziev) - #23040: Don't create a new account-nav block - use existing instead. (by @vovayatsyuk) - #23036: [Framework] Reassign fields variable after converting to array (by @Den4ik) - #22989: Properly transliterate German Umlauts (by @amenk) Fixed GitHub Issues: - #23045: Exceptions from data patches do not show root cause (reported by @ashsmith) has been fixed in #23046 by @ashsmith in 2.3-develop branch Related commits: 1. 199887d 2. c0d920d - #22882: Static content deploy - Don't shows error message, just stack trace (reported by @ihor-sviziev) has been fixed in #22884 by @ihor-sviziev in 2.3-develop branch Related commits: 1. 881e927
2 parents 923303d + a8d1ea1 commit 98703f6

File tree

9 files changed

+64
-72
lines changed

9 files changed

+64
-72
lines changed

SECURITY.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Reporting Security Issues
2+
3+
Magento values the contributions of the security research community, and we look forward to working with you to minimize risk to Magento merchants.
4+
5+
## Where should I report security issues?
6+
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.
8+
9+
## Learning More About Security
10+
To learn more about securing a Magento store, please visit the [Security Center](https://magento.com/security).

app/code/Magento/Customer/view/frontend/layout/customer_account_forgotpassword.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<head>
10-
<title>Forgot Your Password</title>
10+
<title>Forgot Your Password?</title>
1111
</head>
1212
<body>
1313
<referenceBlock name="root">

app/code/Magento/Deploy/Service/DeployPackage.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ function () use ($package, $options, $skipLogging) {
107107
}
108108

109109
/**
110+
* Execute package deploy procedure when area already emulated
111+
*
110112
* @param Package $package
111113
* @param array $options
112114
* @param bool $skipLogging
@@ -136,7 +138,9 @@ public function deployEmulated(Package $package, array $options, $skipLogging =
136138
$this->errorsCount++;
137139
$this->logger->critical($errorMessage);
138140
} catch (\Exception $exception) {
139-
$this->logger->critical($exception->getTraceAsString());
141+
$this->logger->critical(
142+
'Compilation from source ' . $file->getSourcePath() . ' failed' . PHP_EOL . (string)$exception
143+
);
140144
$this->errorsCount++;
141145
}
142146
}
@@ -219,7 +223,9 @@ private function checkIfCanCopy(PackageFile $file, Package $package, Package $pa
219223
private function checkFileSkip($filePath, array $options)
220224
{
221225
if ($filePath !== '.') {
226+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
222227
$ext = strtolower(pathinfo($filePath, PATHINFO_EXTENSION));
228+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
223229
$basename = pathinfo($filePath, PATHINFO_BASENAME);
224230
if ($ext === 'less' && strpos($basename, '_') === 0) {
225231
return true;

app/design/frontend/Magento/luma/Magento_Customer/layout/customer_account.xml

Lines changed: 6 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,12 @@
77
-->
88
<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
10-
<referenceContainer name="sidebar.main">
11-
<block class="Magento\Framework\View\Element\Template" name="customer_account_navigation_block" template="Magento_Theme::html/collapsible.phtml" before="-">
12-
<arguments>
13-
<argument name="block_title" translate="true" xsi:type="string">My Account</argument>
14-
<argument name="block_css" xsi:type="string">block-collapsible-nav</argument>
15-
</arguments>
16-
<block class="Magento\Customer\Block\Account\Navigation" name="customer_account_navigation" before="-">
17-
<arguments>
18-
<argument name="css_class" xsi:type="string">nav items</argument>
19-
</arguments>
20-
<block class="Magento\Customer\Block\Account\SortLinkInterface" name="customer-account-navigation-account-link">
21-
<arguments>
22-
<argument name="label" xsi:type="string" translate="true">My Account</argument>
23-
<argument name="path" xsi:type="string">customer/account</argument>
24-
<argument name="sortOrder" xsi:type="number">250</argument>
25-
</arguments>
26-
</block>
27-
<block class="Magento\Customer\Block\Account\Delimiter" name="customer-account-navigation-delimiter-1"
28-
template="Magento_Customer::account/navigation-delimiter.phtml">
29-
<arguments>
30-
<argument name="sortOrder" xsi:type="number">200</argument>
31-
</arguments>
32-
</block>
33-
<block class="Magento\Customer\Block\Account\SortLinkInterface" name="customer-account-navigation-address-link">
34-
<arguments>
35-
<argument name="label" xsi:type="string" translate="true">Address Book</argument>
36-
<argument name="path" xsi:type="string">customer/address</argument>
37-
<argument name="sortOrder" xsi:type="number">190</argument>
38-
</arguments>
39-
</block>
40-
<block class="Magento\Customer\Block\Account\SortLinkInterface" name="customer-account-navigation-account-edit-link">
41-
<arguments>
42-
<argument name="label" xsi:type="string" translate="true">Account Information</argument>
43-
<argument name="path" xsi:type="string">customer/account/edit</argument>
44-
<argument name="sortOrder" xsi:type="number">180</argument>
45-
</arguments>
46-
</block>
47-
<block class="Magento\Customer\Block\Account\Delimiter" name="customer-account-navigation-delimiter-2"
48-
template="Magento_Customer::account/navigation-delimiter.phtml">
49-
<arguments>
50-
<argument name="sortOrder" xsi:type="number">130</argument>
51-
</arguments>
52-
</block>
53-
</block>
54-
</block>
55-
</referenceContainer>
10+
<referenceBlock name="sidebar.main.account_nav">
11+
<arguments>
12+
<argument name="block_title" translate="true" xsi:type="string">My Account</argument>
13+
<argument name="block_css" xsi:type="string">block-collapsible-nav</argument>
14+
</arguments>
15+
</referenceBlock>
5616
<move element="page.main.title" destination="content.top" before="-"/>
5717
</body>
5818
</page>

lib/internal/Magento/Framework/Filter/Test/Unit/TranslitTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
namespace Magento\Framework\Filter\Test\Unit;
77

8+
/**
9+
* Translit test.
10+
*/
811
class TranslitTest extends \PHPUnit\Framework\TestCase
912
{
1013
/**
@@ -45,8 +48,8 @@ public function filterDataProvider()
4548
['привет мир', 'privet mir', 'privet mir', $isIconv],
4649
[
4750
'Weiß, Goldmann, Göbel, Weiss, Göthe, Goethe und Götz',
48-
'Weiss, Goldmann, Gobel, Weiss, Gothe, Goethe und Gotz',
49-
'Weiss, Goldmann, Gobel, Weiss, Gothe, Goethe und Gotz',
51+
'Weiss, Goldmann, Goebel, Weiss, Goethe, Goethe und Goetz',
52+
'Weiss, Goldmann, Goebel, Weiss, Goethe, Goethe und Goetz',
5053
$isIconv
5154
],
5255
[

lib/internal/Magento/Framework/Filter/Test/Unit/TranslitUrlTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
namespace Magento\Framework\Filter\Test\Unit;
77

8+
/**
9+
* Translit url test.
10+
*/
811
class TranslitUrlTest extends \PHPUnit\Framework\TestCase
912
{
1013
/**
@@ -45,8 +48,8 @@ public function filterDataProvider()
4548
['привет мир', 'privet-mir', 'privet-mir', $isIconv],
4649
[
4750
'Weiß, Goldmann, Göbel, Weiss, Göthe, Goethe und Götz',
48-
'weiss-goldmann-gobel-weiss-gothe-goethe-und-gotz',
49-
'weiss-goldmann-gobel-weiss-gothe-goethe-und-gotz',
51+
'weiss-goldmann-goebel-weiss-goethe-goethe-und-goetz',
52+
'weiss-goldmann-goebel-weiss-goethe-goethe-und-goetz',
5053
$isIconv
5154
],
5255
[

lib/internal/Magento/Framework/Filter/Translit.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Translit implements \Zend_Filter_Interface
2525
'À' => 'a',
2626
'Á' => 'a',
2727
'Â' => 'a',
28-
'Ä' => 'a',
28+
'Ä' => 'ae',
2929
'Å' => 'a',
3030
'Æ' => 'ae',
3131
'Ç' => 'c',
@@ -40,18 +40,18 @@ class Translit implements \Zend_Filter_Interface
4040
'Ó' => 'o',
4141
'Ô' => 'o',
4242
'Õ' => 'o',
43-
'Ö' => 'o',
43+
'Ö' => 'oe',
4444
'Ø' => 'o',
4545
'Ù' => 'u',
4646
'Ú' => 'u',
4747
'Û' => 'u',
48-
'Ü' => 'u',
48+
'Ü' => 'ue',
4949
'Ý' => 'y',
5050
'ß' => 'ss',
5151
'à' => 'a',
5252
'á' => 'a',
5353
'â' => 'a',
54-
'ä' => 'a',
54+
'ä' => 'ae',
5555
'å' => 'a',
5656
'æ' => 'ae',
5757
'ç' => 'c',
@@ -67,12 +67,12 @@ class Translit implements \Zend_Filter_Interface
6767
'ó' => 'o',
6868
'ô' => 'o',
6969
'õ' => 'o',
70-
'ö' => 'o',
70+
'ö' => 'oe',
7171
'ø' => 'o',
7272
'ù' => 'u',
7373
'ú' => 'u',
7474
'û' => 'u',
75-
'ü' => 'u',
75+
'ü' => 'ue',
7676
'ý' => 'y',
7777
'þ' => 'p',
7878
'ÿ' => 'y',

lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* @SuppressWarnings(PHPMD.NumberOfChildren)
1919
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2020
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
21+
* phpcs:disable Magento2.Classes.AbstractApi
2122
* @api
2223
*/
2324
abstract class AbstractDb extends AbstractResource
@@ -604,7 +605,7 @@ protected function _checkUnique(\Magento\Framework\Model\AbstractModel $object)
604605
$fields = $this->getUniqueFields();
605606
if (!empty($fields)) {
606607
if (!is_array($fields)) {
607-
$this->_uniqueFields = [['field' => $fields, 'title' => $fields]];
608+
$fields = $this->_uniqueFields = [['field' => $fields, 'title' => $fields]];
608609
}
609610

610611
$data = new \Magento\Framework\DataObject($this->_prepareDataForSave($object));

lib/internal/Magento/Framework/Setup/Patch/PatchApplier.php

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Magento\Framework\Module\ModuleList;
1111
use Magento\Framework\ObjectManagerInterface;
1212
use Magento\Framework\Phrase;
13-
use Magento\Framework\Setup\Exception;
13+
use Magento\Framework\Setup\Exception as SetupException;
1414
use Magento\Framework\Setup\ModuleDataSetupInterface;
1515

1616
/**
@@ -129,8 +129,8 @@ public function __construct(
129129
/**
130130
* Apply all patches for one module
131131
*
132-
* @param null | string $moduleName
133-
* @throws Exception
132+
* @param null|string $moduleName
133+
* @throws SetupException
134134
*/
135135
public function applyDataPatch($moduleName = null)
136136
{
@@ -149,7 +149,7 @@ public function applyDataPatch($moduleName = null)
149149
['moduleDataSetup' => $this->moduleDataSetup]
150150
);
151151
if (!$dataPatch instanceof DataPatchInterface) {
152-
throw new Exception(
152+
throw new SetupException(
153153
new Phrase("Patch %1 should implement DataPatchInterface", [get_class($dataPatch)])
154154
);
155155
}
@@ -164,7 +164,17 @@ public function applyDataPatch($moduleName = null)
164164
$this->moduleDataSetup->getConnection()->commit();
165165
} catch (\Exception $e) {
166166
$this->moduleDataSetup->getConnection()->rollBack();
167-
throw new Exception(new Phrase($e->getMessage()));
167+
throw new SetupException(
168+
new Phrase(
169+
'Unable to apply data patch %1 for module %2. Original exception message: %3',
170+
[
171+
get_class($dataPatch),
172+
$moduleName,
173+
$e->getMessage()
174+
]
175+
),
176+
$e
177+
);
168178
} finally {
169179
unset($dataPatch);
170180
}
@@ -173,8 +183,7 @@ public function applyDataPatch($moduleName = null)
173183
}
174184

175185
/**
176-
* Register all patches in registry in order to manipulate chains and dependencies of patches
177-
* of patches
186+
* Register all patches in registry in order to manipulate chains and dependencies of patches of patches
178187
*
179188
* @param string $moduleName
180189
* @param string $patchType
@@ -207,8 +216,8 @@ private function prepareRegistry($moduleName, $patchType)
207216
*
208217
* Please note: that schema patches are not revertable
209218
*
210-
* @param null | string $moduleName
211-
* @throws Exception
219+
* @param null|string $moduleName
220+
* @throws SetupException
212221
*/
213222
public function applySchemaPatch($moduleName = null)
214223
{
@@ -229,7 +238,7 @@ public function applySchemaPatch($moduleName = null)
229238
$schemaPatch->apply();
230239
$this->patchHistory->fixPatch(get_class($schemaPatch));
231240
} catch (\Exception $e) {
232-
throw new Exception(
241+
throw new SetupException(
233242
new Phrase(
234243
'Unable to apply patch %1 for module %2. Original exception message: %3',
235244
[
@@ -248,8 +257,8 @@ public function applySchemaPatch($moduleName = null)
248257
/**
249258
* Revert data patches for specific module
250259
*
251-
* @param null | string $moduleName
252-
* @throws Exception
260+
* @param null|string $moduleName
261+
* @throws SetupException
253262
*/
254263
public function revertDataPatches($moduleName = null)
255264
{
@@ -270,7 +279,7 @@ public function revertDataPatches($moduleName = null)
270279
$adapter->commit();
271280
} catch (\Exception $e) {
272281
$adapter->rollBack();
273-
throw new Exception(new Phrase($e->getMessage()));
282+
throw new SetupException(new Phrase($e->getMessage()));
274283
} finally {
275284
unset($dataPatch);
276285
}

0 commit comments

Comments
 (0)