Skip to content

Commit e9d894f

Browse files
author
Oleksii Korshenko
authored
Merge pull request #1020 from magento-engcom/develop-prs
Public Pull Requests: #9140 #9204 #9133 #6778 #7556 #8903
2 parents a9bd85b + 6e87013 commit e9d894f

File tree

9 files changed

+36
-50
lines changed

9 files changed

+36
-50
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ atlassian*
4141
!/pub/media/customer/.htaccess
4242
/pub/media/downloadable/*
4343
!/pub/media/downloadable/.htaccess
44+
/pub/media/favicon/*
4445
/pub/media/import/*
4546
!/pub/media/import/.htaccess
4647
/pub/media/theme/*

app/code/Magento/Contact/Model/Mail.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ public function __construct(
4949
*/
5050
public function send($replyTo, array $variables)
5151
{
52+
/** @see \Magento\Contact\Controller\Index\Post::validatedParams() */
53+
$replyToName = !empty($variables['data']['name']) ? $variables['data']['name'] : null;
54+
5255
$this->inlineTranslation->suspend();
5356
try {
5457
$transport = $this->transportBuilder
@@ -62,7 +65,7 @@ public function send($replyTo, array $variables)
6265
->setTemplateVars($variables)
6366
->setFrom($this->contactsConfig->emailSender())
6467
->addTo($this->contactsConfig->emailRecipient())
65-
->setReplyTo($replyTo)
68+
->setReplyTo($replyTo, $replyToName)
6669
->getTransport();
6770

6871
$transport->sendMessage();

app/code/Magento/Weee/view/frontend/layout/checkout_cart_index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<item name="weee" xsi:type="array">
1818
<item name="component" xsi:type="string">Magento_Weee/js/view/cart/totals/weee</item>
1919
<item name="config" xsi:type="array">
20-
<item name="title" xsi:type="string">FPT</item>
20+
<item name="title" xsi:type="string" translate="true">FPT</item>
2121
</item>
2222
</item>
2323
</item>

lib/internal/Magento/Framework/App/Bootstrap.php

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ public function __construct(ObjectManagerFactory $factory, $rootDir, array $init
204204
$this->factory = $factory;
205205
$this->rootDir = $rootDir;
206206
$this->server = $initParams;
207+
$this->objectManager = $this->factory->create($this->server);
207208
}
208209

209210
/**
@@ -227,7 +228,6 @@ public function getParams()
227228
public function createApplication($type, $arguments = [])
228229
{
229230
try {
230-
$this->initObjectManager();
231231
$application = $this->objectManager->create($type, $arguments);
232232
if (!($application instanceof AppInterface)) {
233233
throw new \InvalidArgumentException("The provided class doesn't implement AppInterface: {$type}");
@@ -250,7 +250,6 @@ public function run(AppInterface $application)
250250
try {
251251
\Magento\Framework\Profiler::start('magento');
252252
$this->initErrorHandler();
253-
$this->initObjectManager();
254253
$this->assertMaintenance();
255254
$this->assertInstalled();
256255
$response = $application->launch();
@@ -279,7 +278,6 @@ protected function assertMaintenance()
279278
if (null === $isExpected) {
280279
return;
281280
}
282-
$this->initObjectManager();
283281
/** @var \Magento\Framework\App\MaintenanceMode $maintenance */
284282
$this->maintenance = $this->objectManager->get(\Magento\Framework\App\MaintenanceMode::class);
285283

@@ -312,7 +310,6 @@ protected function assertInstalled()
312310
if (null === $isExpected) {
313311
return;
314312
}
315-
$this->initObjectManager();
316313
$isInstalled = $this->isInstalled();
317314
if (!$isInstalled && $isExpected) {
318315
$this->errorCode = self::ERR_IS_INSTALLED;
@@ -351,7 +348,6 @@ private function getIsExpected($key, $default)
351348
*/
352349
private function isInstalled()
353350
{
354-
$this->initObjectManager();
355351
/** @var \Magento\Framework\App\DeploymentConfig $deploymentConfig */
356352
$deploymentConfig = $this->objectManager->get(\Magento\Framework\App\DeploymentConfig::class);
357353
return $deploymentConfig->isAvailable();
@@ -364,7 +360,6 @@ private function isInstalled()
364360
*/
365361
public function getObjectManager()
366362
{
367-
$this->initObjectManager();
368363
return $this->objectManager;
369364
}
370365

@@ -378,20 +373,7 @@ private function initErrorHandler()
378373
$handler = new ErrorHandler();
379374
set_error_handler([$handler, 'handler']);
380375
}
381-
382-
/**
383-
* Initializes object manager
384-
*
385-
* @return void
386-
*/
387-
private function initObjectManager()
388-
{
389-
if (!$this->objectManager) {
390-
$this->objectManager = $this->factory->create($this->server);
391-
$this->maintenance = $this->objectManager->get(\Magento\Framework\App\MaintenanceMode::class);
392-
}
393-
}
394-
376+
395377
/**
396378
* Getter for error code
397379
*

lib/internal/Magento/Framework/App/ObjectManagerFactory.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ObjectManagerFactory
3232
*
3333
* @var string
3434
*/
35-
protected $_locatorClassName = \Magento\Framework\ObjectManager\ObjectManager::class;
35+
protected $_locatorClassName = \Magento\Framework\App\ObjectManager::class;
3636

3737
/**
3838
* Config class name
@@ -169,7 +169,6 @@ public function create(array $arguments)
169169
$objectManager = new $this->_locatorClassName($this->factory, $diConfig, $sharedInstances);
170170

171171
$this->factory->setObjectManager($objectManager);
172-
ObjectManager::setInstance($objectManager);
173172

174173
$generatorParams = $diConfig->getArguments(\Magento\Framework\Code\Generator::class);
175174
/** Arguments are stored in different format when DI config is compiled, thus require custom processing */

lib/internal/Magento/Framework/Config/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ protected function getIdAttributes()
152152
{
153153
$idAttributes = [
154154
'/view/vars' => 'module',
155-
'/view/vars/var' => 'name',
155+
'/view/vars/(var/)*var' => 'name',
156156
'/view/exclude/item' => ['type', 'item'],
157157
];
158158
foreach ($this->xpath as $attribute) {

lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/_files/invalidConfigXmlArray.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@
178178
</config>',
179179
[
180180
"Element 'virtualType', attribute 'name': [facet 'pattern'] The value '' is not accepted by the pattern '" .
181-
"([a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*)(\\\\[a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*" .
182-
")*'." .
181+
"(\\\\?[a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*)" .
182+
"(\\\\[a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*)*'." .
183183
"\nLine: 2\n",
184184
"Element 'virtualType', attribute 'name': '' is not a valid value of the atomic type 'phpClassName'." .
185185
"\nLine: 2\n",
@@ -188,32 +188,14 @@
188188
"\nLine: 2\n",
189189
],
190190
],
191-
'virtualtype with invalid_name' => [
192-
'<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
193-
<virtualType name="\\BackslashPrefix\\IsNotAllowed" type="TypeName" shared="true"/>
194-
</config>',
195-
[
196-
"Element 'virtualType', attribute 'name': [facet 'pattern'] The value '\\BackslashPrefix\\IsNotAllowed' " .
197-
"is not accepted by the pattern '" .
198-
"([a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*)(\\\\[a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*" .
199-
")*'." .
200-
"\nLine: 2\n",
201-
"Element 'virtualType', attribute 'name': '\\BackslashPrefix\\IsNotAllowed' " .
202-
"is not a valid value of the atomic type 'phpClassName'." .
203-
"\nLine: 2\n",
204-
"Element 'virtualType', attribute 'name': Warning: No precomputed value available, the value was either " .
205-
"invalid or something strange happend." .
206-
"\nLine: 2\n",
207-
],
208-
],
209191
'virtualtype with empty_type' => [
210192
'<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
211193
<virtualType name="Name" type="" shared="true"/>
212194
</config>',
213195
[
214196
"Element 'virtualType', attribute 'type': [facet 'pattern'] The value '' is not accepted by the pattern '" .
215-
"([a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*)(\\\\[a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*" .
216-
")*'." .
197+
"(\\\\?[a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*)" .
198+
"(\\\\[a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*)*'." .
217199
"\nLine: 2\n",
218200
"Element 'virtualType', attribute 'type': '' is not a valid value of the atomic type 'phpClassName'." .
219201
"\nLine: 2\n",
@@ -226,8 +208,8 @@
226208
[
227209
"Element 'virtualType', attribute 'name': [facet 'pattern'] The value '777Digits\\IsNotAllowed' " .
228210
"is not accepted by the pattern '" .
229-
"([a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*)(\\\\[a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*" .
230-
")*'." .
211+
"(\\\\?[a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*)" .
212+
"(\\\\[a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*)*'." .
231213
"\nLine: 2\n",
232214
"Element 'virtualType', attribute 'name': '777Digits\\IsNotAllowed' " .
233215
"is not a valid value of the atomic type 'phpClassName'." .
@@ -237,4 +219,22 @@
237219
"\nLine: 2\n",
238220
],
239221
],
222+
'virtualtype with digits_and_prefix_slash' => [
223+
'<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
224+
<virtualType name="\\777Digits\\IsNotAllowed" type="TypeName" shared="true"/>
225+
</config>',
226+
[
227+
"Element 'virtualType', attribute 'name': [facet 'pattern'] The value '\\777Digits\\IsNotAllowed' " .
228+
"is not accepted by the pattern '" .
229+
"(\\\\?[a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*)" .
230+
"(\\\\[a-zA-Z_\x7f-\xc3\xbf][a-zA-Z0-9_\x7f-\xc3\xbf]*)*'." .
231+
"\nLine: 2\n",
232+
"Element 'virtualType', attribute 'name': '\\777Digits\\IsNotAllowed' " .
233+
"is not a valid value of the atomic type 'phpClassName'." .
234+
"\nLine: 2\n",
235+
"Element 'virtualType', attribute 'name': Warning: No precomputed value available, the value was either " .
236+
"invalid or something strange happend." .
237+
"\nLine: 2\n",
238+
],
239+
],
240240
];

lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/_files/valid_config.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,5 @@
6464
</argument>
6565
</arguments>
6666
</type>
67+
<virtualType name="\BackslashPrefix\IsAllowed" type="TypeName" shared="true"/>
6768
</config>

lib/internal/Magento/Framework/ObjectManager/etc/config.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</xs:documentation>
3737
</xs:annotation>
3838
<xs:restriction base="xs:string">
39-
<xs:pattern value="([a-zA-Z_&#x7f;-&#xff;][a-zA-Z0-9_&#x7f;-&#xff;]*)(\\[a-zA-Z_&#x7f;-&#xff;][a-zA-Z0-9_&#x7f;-&#xff;]*)*"/>
39+
<xs:pattern value="(\\?[a-zA-Z_&#x7f;-&#xff;][a-zA-Z0-9_&#x7f;-&#xff;]*)(\\[a-zA-Z_&#x7f;-&#xff;][a-zA-Z0-9_&#x7f;-&#xff;]*)*"/>
4040
</xs:restriction>
4141
</xs:simpleType>
4242

0 commit comments

Comments
 (0)